home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Technical Documentation / C.S.M.P. Digests / csmp-digest-v3-040 / doubleCR.1 < prev   
Encoding:
Text File  |  1994-07-07  |  132.6 KB  |  3,557 lines

  1. C.S.M.P. Digest             Tue, 28 Jun 94       Volume 3 : Issue 40
  2.  
  3. Today's Topics:
  4.  
  5.         AppleScript Programmer's Dialect
  6.         BlockCompare?
  7.         GX Printing callbacks are C?
  8.         Handling Events during AE OpenDoc Processing
  9.         How to determine which Finder windows are open?
  10.         Metrowerks code generation wierdness
  11.         PPC and 64-bit video (was Re: Fast full screen scrolling: impossible?)
  12.         Playing QuickTime movies
  13.         Quickdraw GX - Why?
  14.         [Q] Programming the AT&T 3210?
  15.  
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  19. (pottier@clipper.ens.fr).
  20.  
  21. The digest is a collection of article threads from the internet newsgroup
  22. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  23. regularly and want an archive of the discussions.  If you don't know what a
  24. newsgroup is, you probably don't have access to it.  Ask your systems
  25. administrator(s) for details.  If you don't have access to news, you may
  26. still be able to post messages to the group by using a mail server like
  27. anon.penet.fi (mail help@anon.penet.fi for more information).
  28.  
  29. Each issue of the digest contains one or more sets of articles (called
  30. threads), with each set corresponding to a 'discussion' of a particular
  31. subject.  The articles are not edited; all articles included in this digest
  32. are in their original posted form (as received by our news server at
  33. nef.ens.fr).  Article threads are not added to the digest until the last
  34. article added to the thread is at least two weeks old (this is to ensure that
  35. the thread is dead before adding it to the digest).  Article threads that
  36. consist of only one message are generally not included in the digest.
  37.  
  38. The digest is officially distributed by two means, by email and ftp.
  39.  
  40. If you want to receive the digest by mail, send email to listserv@ens.fr
  41. with no subject and one of the following commands as body:
  42.     help                        Sends you a summary of commands
  43.     subscribe csmp-digest Your Name    Adds you to the mailing list
  44.     signoff csmp-digest            Removes you from the list
  45. Once you have subscribed, you will automatically receive each new
  46. issue as it is created.
  47.  
  48. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  49. Questions related to the ftp site should be directed to
  50. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  51. digest are available there.
  52.  
  53. Also, the digests are available to WAIS users.  To search back issues
  54. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  55. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  56.  
  57.  
  58. -------------------------------------------------------
  59.  
  60. >From hall_j@sat.mot.com (Joseph Hall)
  61. Subject: AppleScript Programmer's Dialect
  62. Date: Fri, 3 Jun 1994 22:28:40 GMT
  63. Organization: Motorola Inc., Satellite Communications
  64.  
  65. Is the programmer's dialect real, or just a figment of the Language Guide's
  66. imagination?
  67.  
  68. -- 
  69. Joseph Nathan Hall | Joseph's Law of Interface Design: Never give your users
  70. Software Architect | a choice between the easy way and the right way.
  71. Gorca Systems Inc. |                 joseph@joebloe.maple-shade.nj.us (home)
  72. (on assignment)    | (602) 732-2549 (work)  Joseph_Hall-SC052C@email.mot.com
  73.  
  74. +++++++++++++++++++++++++++
  75.  
  76. >From mwalker@netcom.com (Mel Walker)
  77. Date: Mon, 6 Jun 1994 16:02:46 GMT
  78. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  79.  
  80. Joseph Hall (hall_j@sat.mot.com) wrote:
  81. : Is the programmer's dialect real, or just a figment of the Language Guide's
  82. : imagination?
  83.  
  84. Also, are instructions for making dialects published anywhere? Probably 
  85. not, right?
  86. -- 
  87. Mel Walker                                     mwalker@netcom.com
  88. "That is one of the unwritten rules of government bureaucracy:
  89. Doing something idiotic is not advisable; getting caught doing
  90. something idiotic is a disaster." - Mike Royko
  91.  
  92. +++++++++++++++++++++++++++
  93.  
  94. >From minshull.m@applelink.apple.com (Mark Minshull)
  95. Date: Mon, 6 Jun 1994 17:55:42 GMT
  96. Organization: Apple Computer, Inc.
  97.  
  98. In article <1994Jun3.222840.606@sat.mot.com>, hall_j@sat.mot.com (Joseph
  99. Hall) wrote:
  100.  
  101. > Is the programmer's dialect real, or just a figment of the Language Guide's
  102. > imagination?
  103. At this point, it's a still-born project...
  104.  
  105.   Mark
  106. -- 
  107. Mark Minshull                       :       minshull.m@applelink.apple.com
  108. OpenDoc Engineering Manager         :          
  109. Apple Computer, Inc.                :       Apple usually doesn't care 
  110. 1 Infinite Loop, MS 303-3A          :       what I say... When they do
  111. Cupertino, CA  95014                :       my opinions are my own.
  112.  
  113. +++++++++++++++++++++++++++
  114.  
  115. >From minshull.m@applelink.apple.com (Mark Minshull)
  116. Date: Mon, 6 Jun 1994 17:58:00 GMT
  117. Organization: Apple Computer, Inc.
  118.  
  119. In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  120. wrote:
  121.  
  122. > Also, are instructions for making dialects published anywhere? Probably 
  123. > not, right?
  124.  
  125. Right.  The interface is private...
  126.  
  127. -- 
  128. Mark Minshull                       :       minshull.m@applelink.apple.com
  129. OpenDoc Engineering Manager         :          
  130. Apple Computer, Inc.                :       Apple usually doesn't care 
  131. 1 Infinite Loop, MS 303-3A          :       what I say... When they do
  132. Cupertino, CA  95014                :       my opinions are my own.
  133.  
  134. +++++++++++++++++++++++++++
  135.  
  136. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  137. Date: Mon, 6 Jun 1994 20:05:00 GMT
  138. Organization: Apple Computer
  139.  
  140. Joseph Hall, hall_j@sat.mot.com writes:
  141. > Is the programmer's dialect real, or just a figment of the Language Guide's
  142. > imagination?
  143.  
  144. Sue Dumont of the AppleScript team wrote one, but there aren't any plans I
  145. know of to ship it. It's pretty cool, but it needs some work before it's
  146. ready for prime time.
  147.  
  148. --Jens Alfke
  149.   jens_alfke@powertalk              Rebel girl, rebel girl,
  150.             .apple.com              Rebel girl you are the queen of my world
  151.  
  152. +++++++++++++++++++++++++++
  153.  
  154. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  155. Date: Mon, 6 Jun 1994 22:52:01 GMT
  156. Organization: Apple Computer
  157.  
  158. Mel Walker, mwalker@netcom.com writes:
  159. > Also, are instructions for making dialects published anywhere? Probably 
  160. > not, right?
  161.  
  162. Making dialects (a) is pretty complicated and (b) requires more access to the
  163. internals of the AppleScript engine than Apple wants to give 3rd parties. A
  164. large part of it involves writing yacc syntax descriptions whose tables then
  165. get dumped into the dialect file.
  166.  
  167. --Jens Alfke
  168.   jens_alfke@powertalk              Rebel girl, rebel girl,
  169.             .apple.com              Rebel girl you are the queen of my world
  170.  
  171. +++++++++++++++++++++++++++
  172.  
  173. >From mwalker@netcom.com (Mel Walker)
  174. Date: Tue, 7 Jun 1994 17:07:02 GMT
  175. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  176.  
  177. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  178. : Mel Walker, mwalker@netcom.com writes:
  179. : > Also, are instructions for making dialects published anywhere? Probably 
  180. : > not, right?
  181.  
  182. : Making dialects (a) is pretty complicated and (b) requires more access to the
  183. : internals of the AppleScript engine than Apple wants to give 3rd parties. A
  184. : large part of it involves writing yacc syntax descriptions whose tables then
  185. : get dumped into the dialect file.
  186.  
  187. I assume that I could write a scripting component that opened up the
  188. AppleScript component, and translate my "dialect" into AppleScript that
  189. way. Is there anything that would prevent that?
  190.  
  191. -- 
  192. Mel Walker                                     mwalker@netcom.com
  193. "That is one of the unwritten rules of government bureaucracy:
  194. Doing something idiotic is not advisable; getting caught doing
  195. something idiotic is a disaster." - Mike Royko
  196.  
  197. +++++++++++++++++++++++++++
  198.  
  199. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  200. Date: Tue, 7 Jun 1994 22:04:44 GMT
  201. Organization: Apple Computer
  202.  
  203. Mel Walker, mwalker@netcom.com writes:
  204. > I assume that I could write a scripting component that opened up the
  205. > AppleScript component, and translate my "dialect" into AppleScript that
  206. > way. Is there anything that would prevent that?
  207.  
  208. That'd work; your component would just forward all of its calls to
  209. AppleScript. The compile and getsource calls would have to do some
  210. transformation on the source text to change it from/to your syntax to/from
  211. AppleScript. (Don't forget the getsource call or people won't be able to
  212. re-edit compiled scripts!) And also don't forget to fix up the source
  213. positions in the error descriptor when the client wants to know the source
  214. range of the error.
  215.  
  216.  Of course this would only work with one dialect of AppleScript.
  217.  
  218. --Jens Alfke
  219.   jens_alfke@powertalk              Rebel girl, rebel girl,
  220.             .apple.com              Rebel girl you are the queen of my world
  221.  
  222. +++++++++++++++++++++++++++
  223.  
  224. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  225. Date: 9 Jun 1994 08:55:24 GMT
  226. Organization: The Royal Institute of Technology
  227.  
  228. In <minshull.m-060694105800@minshullmac.apple.com> minshull.m@applelink.apple.com (Mark Minshull) writes:
  229.  
  230. >In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  231. >wrote:
  232.  
  233. >> Also, are instructions for making dialects published anywhere? Probably 
  234. >> not, right?
  235.  
  236. >Right.  The interface is private...
  237.  
  238. How come there's a tickle dialect of the OSA then?
  239.  
  240. Cheers,
  241.  
  242.     
  243.                     / h+
  244. -- 
  245.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  246.  
  247.  -- I don't fear death, it's dying that scares me.
  248.  
  249. +++++++++++++++++++++++++++
  250.  
  251. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  252. Date: Thu, 9 Jun 1994 18:29:45 GMT
  253. Organization: Apple Computer
  254.  
  255. Jon W!tte, d88-jwa@dront.nada.kth.se writes:
  256. > How come there's a tickle dialect of the OSA then?
  257.  
  258. That's not an AppleScript dialect, it's an entirely separate OSA component,
  259. like Frontier or QuicKeyScript. The difference is that a dialect is just a
  260. plug-in parser (and unparser) for the AppleScript compiler, whereas a
  261. scripting component is entirely independent of AppleScript. To write a new
  262. scripting component you just have to follow the OSA API, whereas dialects are
  263. pretty tightly coupled to AppleScript's internal parsing engine and build
  264. system.
  265.  
  266. --Jens Alfke
  267.   jens_alfke@powertalk              Rebel girl, rebel girl,
  268.             .apple.com              Rebel girl you are the queen of my world
  269.  
  270. +++++++++++++++++++++++++++
  271.  
  272. >From mwalker@netcom.com (Mel Walker)
  273. Date: Thu, 9 Jun 1994 21:57:58 GMT
  274. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  275.  
  276. Jon Wdtte (d88-jwa@dront.nada.kth.se) wrote:
  277. : In <minshull.m-060694105800@minshullmac.apple.com> minshull.m@applelink.apple.com (Mark Minshull) writes:
  278.  
  279. : >In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  280. : >wrote:
  281.  
  282. : >> Also, are instructions for making dialects published anywhere? Probably 
  283. : >> not, right?
  284.  
  285. : >Right.  The interface is private...
  286.  
  287. : How come there's a tickle dialect of the OSA then?
  288.  
  289. There's not. AppleScript is one OSA _language_ with several _dialects_.
  290.  
  291. Quickeys, tickle, etc. store their internal scripts in a different form
  292. than AppleScript does, so their scripts are not compatible. If you
  293. program AppleScript in the English dialect, and select the French
  294. dialect, the script will change to reflect that without changing
  295. the underlying tokenized form.
  296.  
  297. Did I get that right, O Great Gurus from Apple?
  298. -- 
  299. Mel Walker                                     mwalker@netcom.com
  300. "That is one of the unwritten rules of government bureaucracy:
  301. Doing something idiotic is not advisable; getting caught doing
  302. something idiotic is a disaster." - Mike Royko
  303.  
  304. +++++++++++++++++++++++++++
  305.  
  306. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  307. Date: Fri, 10 Jun 1994 10:03:12 +0800
  308. Organization: Department of Computer Science, The University of Western Australia
  309.  
  310. In article <2t6lds$o2k@news.kth.se>, d88-jwa@dront.nada.kth.se (Jon Wdtte)
  311. wrote:
  312.  
  313. >In <minshull.m-060694105800@minshullmac.apple.com>
  314. minshull.m@applelink.apple.com (Mark Minshull) writes:
  315. >
  316. >>In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  317. >>wrote:
  318. >
  319. >>> Also, are instructions for making dialects published anywhere? Probably 
  320. >>> not, right?
  321. >
  322. >>Right.  The interface is private...
  323. >
  324. >How come there's a tickle dialect of the OSA then?
  325.  
  326. You're confusing your dialects with your OSA scripting components.  A
  327. dialect is a different natural language (or syntax in the case of the
  328. Programmer's Dialect) for *AppleScript*.  An OSA scripting component lets
  329. you implement an entirely different programming language within the
  330. framework of the OSA.
  331.  
  332. So AppleScript currently has 3 dialects (English, French, Japanese) which
  333. all compile to the same language (AppleScript).  There are also buckets of
  334. other OSA scripting components (QuickKeys, TCL, etc).
  335. -- 
  336. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  337. Department of Computer Science, The University of Western Australia
  338.   The cute thing is that you can compile a script in one dialect and
  339.   then decompile it in another.  If only it translated the identifiers.
  340.   Such a shame the Translation Manager doesn't live up to its name (:
  341.  
  342. +++++++++++++++++++++++++++
  343.  
  344. >From msouth@BIX.com (msouth on BIX)
  345. Date: 14 Jun 94 05:31:10 GMT
  346. Organization: Delphi Internet Services Corporation
  347.  
  348. mwalker@netcom.com (Mel Walker) writes:
  349.  
  350. >Quickeys, tickle, etc. store their internal scripts in a different form
  351. >than AppleScript does, so their scripts are not compatible. If you
  352. >program AppleScript in the English dialect, and select the French
  353. >dialect, the script will change to reflect that without changing
  354. >the underlying tokenized form.
  355.  
  356. You know, this is a _perfect_ example of how the Mac is head
  357. and shoulders above anything else. But do you think that anyone
  358. other than a already-dedicated Mac programmer knows about it?
  359. Why on earth doesn't Apple _advertise_ some of this stuff?
  360.  
  361. +++++++++++++++++++++++++++
  362.  
  363. >From 103t_english@west.cscwc.pima.edu
  364. Date: 14 Jun 94 12:45:21 MST
  365. Organization: (none)
  366.  
  367. In article <msouth.771571870@BIX.com>, msouth@BIX.com (msouth on BIX) writes:
  368. > mwalker@netcom.com (Mel Walker) writes:
  369. >>Quickeys, tickle, etc. store their internal scripts in a different form
  370. >>than AppleScript does, so their scripts are not compatible. If you
  371. >>program AppleScript in the English dialect, and select the French
  372. >>dialect, the script will change to reflect that without changing
  373. >>the underlying tokenized form.
  374. > You know, this is a _perfect_ example of how the Mac is head
  375. > and shoulders above anything else. But do you think that anyone
  376. > other than a already-dedicated Mac programmer knows about it?
  377. > Why on earth doesn't Apple _advertise_ some of this stuff?
  378.  
  379. I tell DOS-bigots all the time and their response is: "whoopee! Who would ever
  380. need to do something like that...
  381.  
  382. Oh well.
  383.  
  384.  
  385. Lawson
  386.  
  387. ---------------------------
  388.  
  389. >From spencerl@crl.com (Spencer Low)
  390. Subject: BlockCompare?
  391. Date: 12 Jun 1994 14:44:31 -0700
  392. Organization: LowTek Creations
  393.  
  394. I'm looking for some sample code (preferably in C) that will compare to 
  395. blocks of memory. In other words:
  396.  
  397.    Boolean BlockCompare(Ptr block1, Ptr block2, Size byteCount);
  398.  
  399. The C libraries that come with THINK C include memcmp, but it's 
  400. hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  401. yet still quick.
  402.  
  403. Thanks,
  404. Spencer (btw, I didn't see anything like this at the alt.sources.mac 
  405. archives)
  406. -- 
  407.   Spencer Low       | MaxRAM: Compatible with RD 1.0.1 and 1.0.2,
  408.   LowTek Creations  |         but not yet with RD 1.0.3A.
  409.   spencerl@crl.com  | ftp://crl.com/users/ro/spencerl/
  410.  
  411. +++++++++++++++++++++++++++
  412.  
  413. >From rang@winternet.com (Anton Rang)
  414. Date: 13 Jun 1994 01:32:50 GMT
  415. Organization: Minnesota Angsters
  416.  
  417. In article <2tfvjv$8se@crl2.crl.com> spencerl@crl.com (Spencer Low) writes:
  418. >I'm looking for some sample code (preferably in C) that will compare to 
  419. >blocks of memory. In other words:
  420. >
  421. >   Boolean BlockCompare(Ptr block1, Ptr block2, Size byteCount);
  422. >
  423. >The C libraries that come with THINK C include memcmp, but it's 
  424. >hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  425. >yet still quick.
  426.  
  427.   Just to see if they're equal?
  428.  
  429.   You probably can't beat a loop like this, in C, without adding
  430. various platform dependent tricks:
  431.  
  432.     while (byteCount--)
  433.       if (*block1++ != *block2++)
  434.         return (false);
  435.  
  436.     return (true);
  437.  
  438. If you're using 68K assembly, you can do very well using 'cmpm' and a
  439. 'dbra' variant, if your loop counts will fit in a two-byte variable.
  440. Something along the lines of
  441.  
  442.     @0:    cmpm.l    (a0)+, (a1)+        ; or .b if you really need byte-by-byte
  443.     dbne    @0            ; branch until not-equal
  444.     seq    d0            ; set d0 to be non-zero if they match
  445.     rts                ; return
  446.  
  447. Using memcmp() is your best bet for a platform-independent quick way,
  448. since it's part of the ANSI standard and probably coded in assembly.
  449. --
  450. Anton Rang (rang@winternet.com)
  451.  
  452. +++++++++++++++++++++++++++
  453.  
  454. >From bwade@graphics.cornell.edu (Bretton Wade)
  455. Date: 13 Jun 1994 04:14:26 GMT
  456. Organization: Program of Computer Graphics -- Cornell University
  457.  
  458. probably your best bet if you want to do it in a high level language is to
  459. make a nice unrolled loop. you'd have to know in general that the size of the
  460. block you want to compare is divisible by some factor (say 16)..
  461.  
  462. Boolean    compare (long *a, long *b, long blocksize)
  463. {
  464.     for (short i = 0; i < blocksize; i += 16)
  465.     {
  466.         if (*a++ != *b++) return FALSE;
  467.         if (*a++ != *b++) return FALSE;
  468.         if (*a++ != *b++) return FALSE;
  469.         if (*a++ != *b++) return FALSE;
  470.     }
  471.     return TRUE;
  472. }
  473.  
  474. the more compares you can do inside the loop, the better off you'll be (up to a
  475. point). You may also need a little code that will check any leftover that you
  476. couldn't cover with the big blocks. say you've got 64001 bytes to compare. You
  477. would check the first 64000 with a big block checker, then test the last byte
  478. separately.
  479.  
  480. THINK's memcmp function checks one byte at a time. you should be able to blast
  481. that with C code quite easily...
  482. -- 
  483. _______________________________________________________________________________
  484.  
  485.    Bretton Wade (bw16@cornell.edu)
  486.  
  487.    Program of Computer Graphics
  488.    580 Engineering and Theory Center
  489.    Cornell University
  490.    Ithaca, NY 14853
  491.    Voice: (607) 255-6704
  492.    Fax:   (607) 255-0806
  493. _______________________________________________________________________________
  494.  
  495. +++++++++++++++++++++++++++
  496.  
  497. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  498. Date: Mon, 13 Jun 1994 20:11:26 GMT
  499. Organization: Apple Computer
  500.  
  501. Spencer Low, spencerl@crl.com writes:
  502. > The C libraries that come with THINK C include memcmp, but it's 
  503. > hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  504. > yet still quick.
  505.  
  506. If you want portability, use memcmp. You can't get much more portable than
  507. the ANSI library -- any C implementation you use, anywhere, is guaranteed to
  508. have one.
  509.  
  510. --Jens Alfke
  511.   jens_alfke@powertalk              Rebel girl, rebel girl,
  512.             .apple.com              Rebel girl you are the queen of my world
  513.  
  514. ---------------------------
  515.  
  516. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  517. Subject: GX Printing callbacks are C?
  518. Date: Thu, 9 Jun 1994 18:02:49 GMT
  519. Organization: Apple Computer
  520.  
  521. Looks like the entire GX team is on vacation this week, unless they're just
  522. refusing to return my calls, so I'll have to make like a layperson and ask
  523. the net...  ;-)
  524.  
  525. I'm adding GX print manager support to a QD-based app of mine (well, Sticky
  526. Memos, but this feature won't be in 1.0.) I'm following the prerelease
  527. 'develop' article.
  528.  
  529. I note that the various callbacks you need to install (event filtering and
  530. shape spooling) are not declared as 'pascal' functions. This strikes me as
  531. odd since (as has been discussed recently) there are no standard C calling
  532. conventions on the Mac and the three major C compilers all do things
  533. differently.
  534.  
  535. Is this going to be a problem for me? My app's written in CodeWarrior. The
  536. major thing I remember is that MPW passes all parameters of any size as
  537. longs, so I may have to make sure that any short or Boolean params are
  538. declared in my callback functions as longs. Is there anything else I need to
  539. do (besides declaring the functions as extern "C", of course)?
  540.  
  541. And what do Pascal users do about this? I've heard that MPW Pascal can use C
  542. calling conventions, but what about THINK Pascal? At the risk of not sounding
  543. like a team player, I have to say that this C-callbacks thing in GX may not
  544. have been the most well thought out idea in the world.
  545.  
  546. --Jens Alfke
  547.   jens_alfke@powertalk              Rebel girl, rebel girl,
  548.             .apple.com              Rebel girl you are the queen of my world
  549.  
  550. +++++++++++++++++++++++++++
  551.  
  552. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  553. Date: Fri, 10 Jun 1994 10:30:53 +0800
  554. Organization: Department of Computer Science, The University of Western Australia
  555.  
  556. In article <1994Jun9.180249.25884@gallant.apple.com>, Jens Alfke
  557. <jens_alfke@powertalk.apple.com> wrote:
  558.  
  559. >I note that the various callbacks you need to install (event filtering and
  560. >shape spooling) are not declared as 'pascal' functions. This strikes me as
  561. >odd since (as has been discussed recently) there are no standard C calling
  562. >conventions on the Mac and the three major C compilers all do things
  563. >differently.
  564. >
  565. >Is this going to be a problem for me? My app's written in CodeWarrior. The
  566. >major thing I remember is that MPW passes all parameters of any size as
  567. >longs, so I may have to make sure that any short or Boolean params are
  568. >declared in my callback functions as longs. Is there anything else I need to
  569. >do (besides declaring the functions as extern "C", of course)?
  570.  
  571. The situation is like this...
  572.  
  573. MPW and CodeWarrior Pascal can both call external functions written in C. 
  574. You simply declare the function header and take a "C;" after it, with an
  575. optional "EXTERNAL;" after that.  Think cannot do this and it sucks big
  576. time.
  577.  
  578. *None* of the Pascal compilers can compile a function written in Pascal
  579. that uses C calling conventions.  So if you want to do C calling
  580. convention callbacks you are basically stuffed.
  581.  
  582. My workaround to this is to write the necessary glue in C, where all the
  583. compilers support all the calling conventions.  Peter Lewis (who uses
  584. Think Pascal exclusively) works around this by declaring the functions
  585. with no parameters, getting the value of the A6 register and then walking
  586. up the stack manually.  It's yucky, it's non-portable, it works.
  587.  
  588. btw It's not just a question of making the parameters match in size.  The
  589. problem is that C requires the callee to remove the parameters and Pascal
  590. (normally) has the caller removing them.  So you have to declare the
  591. function with *no* parameters to avoid big dramas with the stack.  Oh yeah
  592. and returning stuff in D0 is kinda hard too.
  593.  
  594. I haven't actually looked through GX yet but if it's full of C callbacks
  595. then I'm gonna be *extremely* depressed.
  596.  
  597. >And what do Pascal users do about this? I've heard that MPW Pascal can use C
  598. >calling conventions, but what about THINK Pascal? At the risk of not sounding
  599. >like a team player, I have to say that this C-callbacks thing in GX may not
  600. >have been the most well thought out idea in the world.
  601.  
  602. Well we get bitter and twisted and wear "C, Stop It or You'll Go Blind!"
  603. T-shirts around WWDC and harrass the guys doing the interfaces about using
  604. a decent IDL so that we can generate Pascal interfaces (and, if necessary,
  605. glue code) automatically.  The depressing thing is that (I think) we've
  606. got a lot of sympathy but there's this little thing called "economic
  607. imperative" that ensures that no one does anything to help.  *sigh*
  608.  
  609. One nice thing is that the PPC has One True Calling Convention (tm). 
  610. Hopefully this will improve matters.
  611.  
  612. Share and Enjoy.
  613. -- 
  614. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  615. Department of Computer Science, The University of Western Australia
  616.   Maintain the Rage!!!
  617.  
  618. +++++++++++++++++++++++++++
  619.  
  620. >From resnick@uiuc.edu (Pete Resnick)
  621. Date: Thu, 09 Jun 1994 22:09:47 -0500
  622. Organization: University of Illinois at Urbana-Champaign
  623.  
  624. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au>,
  625. quinn@cs.uwa.edu.au (Quinn "The Eskimo!") wrote:
  626.  
  627. >btw It's not just a question of making the parameters match in size.  The
  628. >problem is that C requires the callee to remove the parameters and Pascal
  629. >(normally) has the caller removing them.
  630.  
  631. You got that backwards. The caller resets the stack in *C* and the callee
  632. removes them in Pascal.
  633.  
  634. pr
  635. -- 
  636. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  637. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  638. System manager - Cognitive Science Group, Beckman Institute, UIUC
  639. Internet: resnick@uiuc.edu
  640.  
  641. +++++++++++++++++++++++++++
  642.  
  643. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  644. Date: Fri, 10 Jun 1994 21:11:41 GMT
  645. Organization: Apple Computer
  646.  
  647. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au> Quinn,
  648. quinn@cs.uwa.edu.au writes:
  649. > MPW and CodeWarrior Pascal can both call external functions written in C. 
  650.  
  651. Pascal access is certainly an issue, but not the one that immediately
  652. concerns me since I'm writing in C++. The problem is that GX presumably calls
  653. my callbacks with MPW calling conventions*, whereas my functions are
  654. implemented using CodeWarrior conventions. As has been discussed in the
  655. context of linking with .o files, the two are different and you have to be
  656. careful about what size the params are and what register the results get
  657. returned in.
  658.  
  659. *Actually that's not even certain since I know that at least the graphics
  660. engine of GX was developed in THINK C. I'm guessing that for the real builds
  661. they compiled it with MPW, given the MPW-bigotry inside Apple... ;-)
  662.  
  663. --Jens Alfke
  664.   jens_alfke@powertalk              Rebel girl, rebel girl,
  665.             .apple.com              Rebel girl you are the queen of my world
  666.  
  667. +++++++++++++++++++++++++++
  668.  
  669. >From mclow@coyote.csusm.edu (Marshall Clow)
  670. Date: 10 Jun 1994 21:48:39 -0700
  671. Organization: California State University San Marcos
  672.  
  673. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  674. >In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au> Quinn,
  675. >quinn@cs.uwa.edu.au writes:
  676. >> MPW and CodeWarrior Pascal can both call external functions written in C. 
  677.  
  678. >Pascal access is certainly an issue, but not the one that immediately
  679. >concerns me since I'm writing in C++. The problem is that GX presumably calls
  680. >my callbacks with MPW calling conventions*, whereas my functions are
  681. >implemented using CodeWarrior conventions. As has been discussed in the
  682. >context of linking with .o files, the two are different and you have to be
  683. >careful about what size the params are and what register the results get
  684. >returned in.
  685.  
  686.     Starting with GM (dontcha just love it? ;-) the GX header files
  687. contain a "#ifdef applec" section that defines the calls for the MPW C
  688. compiler, and an '#else' section that works for MetroWerks and Think C.
  689. The files affected are PrintingDrivers.h and PrintingMessages.h (I think).
  690.  
  691.     Several of the GX libraries contain "non pascal" routines with
  692. short parameters, but since source to the libs is provided, these interfaces
  693. were not changed.
  694.  
  695. Marshall Clow
  696. Amateur GX Weenie
  697. Aladdin Systems
  698. mclow@san_marcos.csusm.edu
  699. [ Apparently the first person to write a GX printer driver in Think C.]
  700.  
  701.  
  702. +++++++++++++++++++++++++++
  703.  
  704. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  705. Date: 13 Jun 94 18:03:18 +1200
  706. Organization: University of Waikato, Hamilton, New Zealand
  707.  
  708. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au>, quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  709. > In article <1994Jun9.180249.25884@gallant.apple.com>, Jens Alfke
  710. > <jens_alfke@powertalk.apple.com> wrote:
  711. >
  712. >>I note that the various callbacks you need to install (event filtering and
  713. >>shape spooling) are not declared as 'pascal' functions.
  714. >>
  715. >>Is this going to be a problem for me? My app's written in CodeWarrior. The
  716. >>major thing I remember is that MPW passes all parameters of any size as
  717. >>longs, so I may have to make sure that any short or Boolean params are
  718. >>declared in my callback functions as longs. Is there anything else I need to
  719. >>do (besides declaring the functions as extern "C", of course)?
  720. >
  721. > *None* of the Pascal compilers can compile a function written in Pascal
  722. > that uses C calling conventions.  So if you want to do C calling
  723. > convention callbacks you are basically stuffed.
  724. >
  725. > My workaround to this is to write the necessary glue in C, where all the
  726. > compilers support all the calling conventions.  Peter Lewis (who uses
  727. > Think Pascal exclusively) works around this by declaring the functions
  728. > with no parameters, getting the value of the A6 register and then walking
  729. > up the stack manually.  It's yucky, it's non-portable, it works.
  730.  
  731. My workaround is a generic piece of assembly-language glue which looks
  732. something like this:
  733.  
  734.     clr.w    -(sp)    ; room for Pascal function result
  735.     pea    6(sp)    ; pointer to C-format argument list
  736.     jsr    PascalRoutine ; call my Pascal-conforming routine
  737.     move.w    (sp)+, d0 ; return Pascal result to C
  738.     rts
  739.  
  740. The Pascal-conforming routine (in Modula-2, in my case) is declared like this:
  741.  
  742.     PROCEDURE MyHandler
  743.       (
  744.         VAR Args : ArgsForThisRoutine
  745.       ) : OSErr;
  746.  
  747. where "ArgsForThisRoutine" is a record type that mimics the format of the
  748. C argument list. So I refer to the arguments as "Args.whatever". Not too
  749. painful at all.
  750.  
  751. One common case is printing extensions and drivers. This introduces its own
  752. fiddly bits, in that the offsets in the 'over' resources must match the entry
  753. points in your 'pext' code resources. To solve all this, I wrote a custom MPW
  754. tool which takes a file of entry point definitions, and generates .o files for
  755. the segment headers (including the C-to-Pascal glue, above), and the 'over'
  756. resources, all in one fell swoop, so you never have to worry about keeping
  757. them consistent again. Nifty, huh?
  758.  
  759. Lawrence "Just call me the 'Speedbump, the Roadkill Hedgehog' of the
  760. Information Superhighway" D'Oliveiro
  761.  
  762. +++++++++++++++++++++++++++
  763.  
  764. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  765. Date: Tue, 14 Jun 1994 09:44:37 +0800
  766. Organization: Department of Computer Science, The University of Western Australia
  767.  
  768. In article <1994Jun13.180319.29615@waikato.ac.nz>, ldo@waikato.ac.nz
  769. (Lawrence D'Oliveiro, Waikato University) wrote:
  770.  
  771. >My workaround is a generic piece of assembly-language glue which looks
  772. >something like this:
  773. >
  774. >[...]
  775.  
  776. Neat hack!
  777.  
  778. Unfortunately the problem still stands, no matter how neat a hack you use
  779. to work around it ):
  780.  
  781. >Lawrence "Just call me the 'Speedbump, the Roadkill Hedgehog' of the
  782. >Information Superhighway" D'Oliveiro
  783.  
  784. *laugh*
  785. -- 
  786. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  787. Department of Computer Science, The University of Western Australia
  788.  
  789. ---------------------------
  790.  
  791. >From cvafy002@csupomona.edu
  792. Subject: Handling Events during AE OpenDoc Processing
  793. Date: 13 Jun 94 00:52:37 PST
  794. Organization: California State Polytechnic University, Pomona
  795.  
  796. What's the best way to handle event processing during an AppleEvent
  797. OpenDocument event?
  798.  
  799. In my application I step thru the docList retrieved from the AppleEvent and
  800. call my OpenDocument routine on each document as it is pulled out of the list.
  801. I'd like to put up a MovableModal or Modeless dialog to show progress and also
  802. allow the user to switch to other applications and even drop more documents on
  803. my application while it is running (I'm using a suspend/resume appleevent
  804. routine similar to the ones used in DragonSmith). Should I setup another event
  805. loop that I call during the Opening of the documents? All my application does
  806. is rename files based on settings the user specifies beforhand so the actual
  807. operations on each file are small but, I'd like get a good strategy for
  808. handling events when the processing time for each document increases.
  809.  
  810. Any comments are appreciated.
  811.  
  812.  
  813. +++++++++++++++++++++++++++
  814.  
  815. >From decartwr@gamera.syr.edu (Dana Cartwright 3rd)
  816. Date: Mon, 13 Jun 1994 11:45:06 GMT
  817. Organization: Syracuse University, Syracuse, New York
  818.  
  819. cvafy002@csupomona.edu wrote:
  820. : ..... I'd like get a good strategy for
  821. : handling events when the processing time for each document increases.
  822.  
  823. A strategy I use (and others in this group have mentioned similar
  824. strategies) is to divide my app into two parts, call them "hot" and
  825. "cool".  The "hot" part is responsible for being highly responsive to
  826. user requests (keystrokes and menu actions).  The "cool" part handles
  827. things which take a longer time.
  828.  
  829. In the "hot" sections, anything which would take a long time to execute
  830. is avoided...instead, a request is enqueued for the "cool" code to do
  831. the long-running work (the details of how this is done probably depend
  832. on your app, see my strategy below).       
  833.  
  834. When I call WNE and find I have no events queued up for me, I then
  835. dispatch the "cool" code.  It looks in its work-to-be-done queue and
  836. starts grinding away.  Since these are long-running tasks, there's a lot
  837. of the style of coding where tasks are interrupted with calls to WNE.
  838.  
  839. When the "cool" code is running, it will happen (frequently) that the
  840. user does something which causes the "hot" code to run.  So the "cool"
  841. and the "hot" code have to understand that they may run interleaved.
  842.  
  843. Note: this description is basically a description of cooperative multi-
  844. tasking, but carried out within one app rather than among apps.  The
  845. point is that it works beautifully.....my apps are highly responsive
  846. to mouse clicks, and you can "stack" a whole series of them with the
  847. app giving very quick visual feedback...also, you can issue a bunch of
  848. mouse clicks and then switch my app into the background.....all the
  849. "cool" code expects that it may run while the app is in the background.
  850.  
  851. Now, for my enqueue strategy: it's extremely simple!  I just have a 
  852. global 32-bit word in which each bit corresponds to some "cool" task.
  853. When the "hot" code sees that it needs to ask the "cool" routines to
  854. take on some work, it just flips on whichever of the 32 bits corresponds
  855. to that particular task.  In the "cool" code, there are up to 32
  856. tasks which can be dispatched, keyed off the 32 bits of the dispatch
  857. word.  By the way, since I dispatch starting with the left-most bit,
  858. I also achieve a strict prioritization: higher priority "cool" tasks
  859. are given bits near the high-order end of the 32-bit word.  Since
  860. enqueue/dequeue of tasks is no harder than flipping a bit, I've not
  861. got much overhead.
  862.  
  863. Anyway, I've used this strategy in several commercial apps, and users
  864. have commented on how responsive the software seems to be....so I
  865. claim some success!
  866.  
  867.  
  868. +++++++++++++++++++++++++++
  869.  
  870. >From partingt@fwi.uva.nl (Vincent Partington)
  871. Date: 14 Jun 1994 10:30:17 +0200
  872. Organization: FWI, University of Amsterdam
  873.  
  874. cvafy002@csupomona.edu writes:
  875.  
  876. >What's the best way to handle event processing during an AppleEvent
  877. >OpenDocument event?
  878.  
  879. The other replier mentioned partitioning his application into a "hot" and
  880. "cold" part. I do something similar but the implementation is
  881. different. I divide my programs into an interface part and a grunt-work part.
  882.  
  883. The interface part handles the interface stuff and has to be quick in giving
  884. time to other apps and is centered around the event loop. When the interface
  885. part wants the grunt-work part to do something it sends an Apple Event with
  886. all necessary information to itself.
  887.  
  888. The grunt-work part gets this information from the AppleEvent and starts
  889. processing but calls the "Yield" function at regular intervals. The Yield
  890. functions is the interface part: it does a WaitNextEvent and handles events
  891. until a null event comes up. Then the grunt-work part can continue.
  892.  
  893. The advantage of this recursion is that I have one event-loop and that the
  894. grunt-work part can be structured like you would on a machine with preemptive
  895. multitasking and no event-loop. You only have to call Yield once in a while,
  896. you don't have to split up your work and do it in little chunks getting the
  897. necessary status info from flag words and such (was I doing X or Y?).
  898.  
  899. But because of the recursion care should be taken not to get into infinite
  900. recursion. I do this by calling the "Activate" method of my Application-class
  901. when ever the grunt-work part start to do stuff that could take long: that
  902. method disables the menubar and sets the event mask to exclude High Level
  903. events. It also sets a flag so the Yield function knows to give a sleep time
  904. of 0 ticks to WaitNextEvent. At the end of the grunt-work function (the Apple
  905. Event handler) the "Deactivate" method is called and the application returns
  906. to idle state.
  907.  
  908. Another advantage is that all communication goes to the grunt-work part
  909. through Apple Events: because of this my applications are recordable and
  910. scriptable.
  911.  
  912. I have developed no commercial applications with this, but I'm developing a
  913. C++ DropBox class library using this approach. The idea is to make it easy
  914. to implement an algorithm for file conversion (like Unix "filters") without
  915. having to muck about with event loops. 
  916. This class library should see the public domain when CodeWarrior supports
  917. exception handling and templates, so I can test my exception handling code.
  918.  
  919. Vincent.
  920. -- 
  921. My opinions are not my own. I copy them    | Internet : partingt@fwi.uva.nl
  922. from books, television, video, the net,    |            vincent@tnc.nl
  923. my friends, my parents, my teachers and    | FidoNet  : 2:281/202.15
  924. and numerous other contributors.           | NeST     : 90:500/202.15
  925.  
  926. ---------------------------
  927.  
  928. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  929. Subject: How to determine which Finder windows are open?
  930. Date: Fri, 10 Jun 1994 23:17:19 GMT
  931. Organization: Best Before Yesterday
  932.  
  933.  
  934. Up until a few weeks ago I thought it was impossible to read information
  935. such as which Finder windows are open, the positions of icons in that
  936. window (I know that's in the DB, but I don't know how to check for the open
  937. window), etc.
  938.  
  939. However, Popup Folder lets you click on a finder folder and see some stuff
  940. about its hierarchy. So there MUST be a way! Also, that screen saver
  941. software that has stuff interacting with your finder windows.
  942.  
  943. I've posted once already with no reply, and this information would be
  944. really useful for me. Can anyone help me by telling me how my app can find
  945. out ANY of these:
  946.  
  947. o   The open windows in the Finder
  948. o   The names / folder paths of open windows in the Finder
  949. o   The names and locations of folders in an open window in the Finder
  950.  
  951. Thanks!
  952.  
  953.  
  954. Alex
  955.  
  956. --
  957. Alex Metcalf, Best Before Yesterday
  958. Mac programmer in C, C++, HyperTalk, assembler
  959. Juggler, 3-ball tricks
  960.  
  961. Internet:          alex@metcalf.demon.co.uk
  962. Fax (UK):          (0570) 45636
  963. Fax (US / Canada): 011 44 570 45636
  964.  
  965. +++++++++++++++++++++++++++
  966.  
  967. >From gurgle@netcom.com (Pete Gontier)
  968. Date: Mon, 13 Jun 1994 05:37:31 GMT
  969. Organization: cellular
  970.  
  971. alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  972.  
  973. >Up until a few weeks ago I thought it was impossible to read
  974. >information such as which Finder windows are open, the positions of
  975. >icons in that window (I know that's in the DB, but I don't know how
  976. >to check for the open window), etc. However, Popup Folder lets you
  977. >click on a finder folder and see some stuff about its hierarchy. So
  978. >there MUST be a way! Also, that screen saver software that has stuff
  979. >interacting with your finder windows.
  980.  
  981. The question is not whether it can be done or how it can be done. Those
  982. are comparatively easy questions, and I will take a swipe at answering
  983. them below. The really interesting question, however, is this: do you
  984. really want to?
  985.  
  986. Finder is an application. Like many apps, it stores data in the 'refCon'
  987. field of its window records. That data, I believe, is a handle, but
  988. perhaps a pointer, to a C++ object which contains handles or pointers
  989. to other C++ objects, etc. etc. Using MacsBug, you can reverse engineer
  990. these *absitively posolutely private* data structures to determine the
  991. information you want.
  992.  
  993. Of course, this assumes you somehow have access to Finder's window list.
  994. You'll probably have to write an INIT resource to do this.
  995.  
  996. This is the first part of the question: do you really want to do all the
  997. work involved in this reverse engineering? It's non-trivial, especially
  998. if your MacsBug skills are not polished.
  999.  
  1000. The second part of the question is more of the same. Assuming you want
  1001. to put in this kind of work, are you willing to put in this kind of work
  1002. for System 7, System 7.1, System 7 Pro, and System 7.5? How about System
  1003. 6 and for each version of the System before? And each version of the
  1004. System after 7.5? Because the information is different in all of these
  1005. cases.
  1006.  
  1007. I'm not trying to be a wet blanket, but I do feel like I ought to try to
  1008. discourage you for your own good. You can do it; I've done it. But you
  1009. had better be sure it's worth the effort.
  1010. -- 
  1011.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  1012.  
  1013.  "...where they burn books, people are next." -- XTC
  1014.  
  1015. +++++++++++++++++++++++++++
  1016.  
  1017. >From jwbaxter@olympus.net (John W. Baxter)
  1018. Date: Mon, 13 Jun 1994 00:06:49 -0700
  1019. Organization: Internet for the Olympic Peninsula
  1020.  
  1021. In article <gurgleCrBMAK.61D@netcom.com>, gurgle@netcom.com (Pete Gontier)
  1022. wrote:
  1023.  
  1024. > alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  1025. > >Up until a few weeks ago I thought it was impossible to read
  1026. > >information such as which Finder windows are open, the positions of
  1027. > >icons in that window (I know that's in the DB, but I don't know how
  1028. > >to check for the open window), etc. However, Popup Folder lets you
  1029. > >click on a finder folder and see some stuff about its hierarchy. So
  1030. > >there MUST be a way! Also, that screen saver software that has stuff
  1031. > >interacting with your finder windows.
  1032. > The question is not whether it can be done or how it can be done. Those
  1033. > are comparatively easy questions, and I will take a swipe at answering
  1034. > them below. The really interesting question, however, is this: do you
  1035. > really want to?
  1036. > ... [Reverse engineering 1.01 omitted]
  1037. > The second part of the question is more of the same. Assuming you want
  1038. > to put in this kind of work, are you willing to put in this kind of work
  1039. > for System 7, System 7.1, System 7 Pro, and System 7.5? How about System
  1040. > 6 and for each version of the System before? And each version of the
  1041. > System after 7.5? Because the information is different in all of these
  1042. > cases.
  1043. > I'm not trying to be a wet blanket, but I do feel like I ought to try to
  1044. > discourage you for your own good. You can do it; I've done it. But you
  1045. > had better be sure it's worth the effort.
  1046.  
  1047. Particulary, does he want to do this for System 7.5, whose Finder is happy
  1048. to tell you:
  1049.  
  1050. tell application "Finder"
  1051.     get every window
  1052. end tell
  1053.  
  1054. will return something like this (translated to text, from its list of
  1055. objects form):
  1056.     {window of folder "HyperCard 2.2" of startup disk of application
  1057. "Finder", window of startup disk of application "Finder"}
  1058.  
  1059. And
  1060. tell application "Finder"
  1061.     get name of every window
  1062. end tell
  1063.  
  1064. will return just the names, if that's all you want:  {"HyperCard 2.2",
  1065. "Vashon"}
  1066.  
  1067. Seems a whole lot simpler to me.  [Alex's own app can send the necessary
  1068. event.]
  1069.  
  1070. -- 
  1071. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1072.    No hablo Intel.
  1073.    jwbaxter@pt.olympus.net
  1074.  
  1075. ---------------------------
  1076.  
  1077. >From jrrk@camcon.co.uk (Jonathan Kimmitt)
  1078. Subject: Metrowerks code generation wierdness
  1079. Date: 6 Jun 94 21:10:45 GMT
  1080. Organization: Cambridge Consultants Limited
  1081.  
  1082. Has anybody noticed that Metrowerks DR/2 and DR/3 return values from
  1083. functions
  1084. in different registers depending on what the function result type is ?
  1085.  
  1086. a function such as 'char *xmalloc(long)' returns in A0
  1087. whereas a function such as 'long temps(void)' returns in D0
  1088.  
  1089. No other compiler that I have ever seen for the 68K does this. ANSI C
  1090. allows this,
  1091. but as far as I can see it is impossible to guarantee correct code unless
  1092. 'require prototypes' is checked, which makes it more difficult to port
  1093. old non ANSI (K&R) code.
  1094.  
  1095. For the above functions declared in file A (xmalloc is a function which
  1096. allocates
  1097. memory), if file B contains
  1098.  
  1099.     {
  1100.     struct junk *ptr = (struct junk *)xmalloc(sizeof(struct junk));
  1101.     .....
  1102.  
  1103.  
  1104. incorrect code will be generated if your forget to use the prototype
  1105. because xmalloc will be assumed to return int and the value to be put in
  1106. ptr
  1107. will be assumed to be in D0, whereas the actual function will put the
  1108. result in A0
  1109. before returning. The result is that ptr will end up pointing to a random
  1110. location
  1111. in memory and will most likely cause a bus error or crash your mac.
  1112.  
  1113. THINK C (with 4-byte ints on), MPW and gcc will handle this case
  1114. correctly, so if
  1115. you are porting to Metrowerks you might not notice this bug in your code
  1116. until
  1117. it is too late.
  1118.  
  1119. One might speculate that this feature was implemented to improve
  1120. efficiency, since theoretically a pointer returned in A0 can be used
  1121. immediately. In practise it means
  1122. that code resources developed with Metrowerks might not be able to be 
  1123. used with another compiler
  1124. if they return pointers, and vice versa. Since this is a compatability
  1125. issue, one would 
  1126. expect that this feature should be made optional. Your constructive
  1127. comments are invited ...
  1128.  
  1129. +++++++++++++++++++++++++++
  1130.  
  1131. >From zstern@adobe.com (Zalman Stern)
  1132. Date: Tue, 7 Jun 1994 01:26:27 GMT
  1133. Organization: Adobe Systems Incorporated
  1134.  
  1135. Jonathan Kimmitt writes
  1136. > One might speculate that this feature was implemented to improve
  1137. > efficiency, since theoretically a pointer returned in A0 can be used
  1138. > immediately. In practise it means
  1139. > that code resources developed with Metrowerks might not be able to be 
  1140. > used with another compiler
  1141. > if they return pointers, and vice versa. Since this is a compatability
  1142. > issue, one would 
  1143. > expect that this feature should be made optional. Your constructive
  1144. > comments are invited ...
  1145.  
  1146. The 68k Macintosh has no standard C calling convention. The solution for  
  1147. things like code resources is to use the Pascal calling convention for every  
  1148. cross-interface call. In a couple years, PowerPC will have totally taken  
  1149. over and such concerns (along with A5 and A4 worlds) will be but dim  
  1150. nightmares from the past.
  1151. --
  1152. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1153. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1154.    Never let a "final candidate" subscript get above the age of consent.
  1155.  
  1156. +++++++++++++++++++++++++++
  1157.  
  1158. >From johnmce@world.std.com (John McEnerney)
  1159. Date: Tue, 7 Jun 1994 15:42:08 GMT
  1160. Organization: The World Public Access UNIX, Brookline, MA
  1161.  
  1162.  
  1163. >a function such as 'char *xmalloc(long)' returns in A0
  1164. >whereas a function such as 'long temps(void)' returns in D0
  1165. >
  1166. >No other compiler that I have ever seen for the 68K does this. ANSI C
  1167. >allows this,
  1168. >but as far as I can see it is impossible to guarantee correct code unless
  1169. >'require prototypes' is checked, which makes it more difficult to port
  1170. >old non ANSI (K&R) code.
  1171.  
  1172. As far as the ANSI standard is concerned, it would never be correct to 
  1173. call a function defined as returning a pointer when there is no 
  1174. declaration in scope. You cannot assume that 'int' and 'pointer' have the 
  1175. same representation, and we are allowed to use different calling 
  1176. conventions for them.
  1177.  
  1178. You can force the compiler to return pointers in D0 (this is sometimes 
  1179. necessary for calling C code generated by the MPW compiler) by using
  1180.  
  1181. #pragma pointers_in_D0
  1182.  
  1183. -- John McEnerney, Metrowerks PowerPC Product Architect
  1184.  
  1185.  
  1186. +++++++++++++++++++++++++++
  1187.  
  1188. >From astalker@nickel.ucs.indiana.edu (Altan J. Stalker)
  1189. Date: Tue, 7 Jun 1994 15:23:57 GMT
  1190. Organization: Indiana University, Bloomington IN
  1191.  
  1192. In article <46180@io.camcon.co.uk>, Jonathan Kimmitt <jrrk@camcon.co.uk> wrote:
  1193. >Has anybody noticed that Metrowerks DR/2 and DR/3 return values from
  1194. >functions
  1195. >in different registers depending on what the function result type is ?
  1196. >
  1197. > [stuff deleted]
  1198. >
  1199. > ... Since this is a compatability
  1200. > issue, one would 
  1201. > expect that this feature should be made optional. Your constructive
  1202. > comments are invited ...
  1203.  
  1204. Although I have never used it, a pragma exists to turn this feature
  1205. on and off.
  1206.  
  1207. pointers_in_A0   Make functions return pointers in the 68000 register A0
  1208.          [default]
  1209.  
  1210. pointers_in_d0   Make functions return pointers in the 68000 D0 register
  1211.                  [what you wanted]
  1212.  
  1213. (this is from the _Metrowerks C Language Reference DR/2_ page 13)
  1214.  
  1215. --
  1216. Altan J. Stalker, Indiana University, Bloomington IN
  1217. astalker@nickel.ucs.indiana.edu
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224. +++++++++++++++++++++++++++
  1225.  
  1226. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1227. Date: Wed, 8 Jun 1994 16:13:53 +1200 (NZST)
  1228. Organization: (none)
  1229.  
  1230. zstern@adobe.com (Zalman Stern) writes:
  1231. > The 68k Macintosh has no standard C calling convention. The solution for  
  1232. > things like code resources is to use the Pascal calling convention for every  
  1233. > cross-interface call. In a couple years, PowerPC will have totally taken  
  1234. > over and such concerns (along with A5 and A4 worlds) will be but dim  
  1235. > nightmares from the past.
  1236.  
  1237. ... to be replaced by new nightmares such as having to remember to put all
  1238. floating point paramaters after all integer parameters, if you want them
  1239. to fit into registers :-(
  1240.  
  1241. -- Bruce "anyone who designs a calling convention around k&r should be shot" Hoult
  1242.  
  1243. +++++++++++++++++++++++++++
  1244.  
  1245. >From jwbaxter@olympus.net (John W. Baxter)
  1246. Date: Wed, 08 Jun 1994 00:36:39 -0700
  1247. Organization: Internet for the Olympic Peninsula
  1248.  
  1249. In article <2853936833@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz
  1250. (Bruce Hoult) wrote:
  1251.  
  1252. > ... to be replaced by new nightmares such as having to remember to put all
  1253. > floating point paramaters after all integer parameters, if you want them
  1254. > to fit into registers :-(
  1255.  
  1256. Wouldn't have been necessary if the ANSI folks had required prototypes
  1257. instead of offering them as a no-cost extra.  [That would have probably
  1258. exceeded the subcommittee's charter, since it would not have codified
  1259. existing practice, but broken new ground.  It WOULD have produced a better
  1260. language, though.]
  1261.  
  1262. -- 
  1263. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1264.    No hablo Intel.
  1265.    jwbaxter@pt.olympus.net
  1266.  
  1267. +++++++++++++++++++++++++++
  1268.  
  1269. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  1270. Date: 9 Jun 1994 09:15:16 GMT
  1271. Organization: The Royal Institute of Technology
  1272.  
  1273. In <46180@io.camcon.co.uk> jrrk@camcon.co.uk (Jonathan Kimmitt) writes:
  1274.  
  1275. >a function such as 'char *xmalloc(long)' returns in A0
  1276. >whereas a function such as 'long temps(void)' returns in D0
  1277.  
  1278. >No other compiler that I have ever seen for the 68K does this. ANSI C
  1279.  
  1280. Most non-mac compilers for the 68K I've seen does this.
  1281.  
  1282. You can turn it off with #pragma pointers_in_D0
  1283.  
  1284. cheers,
  1285.  
  1286.                     / h+
  1287. -- 
  1288.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  1289.  
  1290.  -- I don't fear death, it's dying that scares me.
  1291.  
  1292. +++++++++++++++++++++++++++
  1293.  
  1294. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1295. Date: 09 Jun 1994 14:30:42 GMT
  1296. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1297.  
  1298.  
  1299. In article <2853936833@hoult.actrix.gen.nz> Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1300. >
  1301. > zstern@adobe.com (Zalman Stern) writes:
  1302. > > [...]   In a couple years, PowerPC will have totally taken  
  1303. > > over and such concerns (along with A5 and A4 worlds) will be but dim  
  1304. > > nightmares from the past.
  1305. >
  1306. >  ... to be replaced by new nightmares such as having to remember to put all
  1307. > floating point paramaters after all integer parameters, if you want them
  1308. > to fit into registers :-(
  1309.  
  1310. i don't know what you mean by this.  the PowerPC calling conventions that
  1311. i'm familiar with do not require this.
  1312.  
  1313. for the PowerPC, standard function calling conventions state that fixed-
  1314. point arguments go in r3-r10, floating-point arguments go in fr1-fr13.
  1315.  
  1316. if you define something like:
  1317.  
  1318.    int foo(int a,float b,int c,double d)
  1319.  
  1320. the parameters will be mapped to registers as follows:
  1321.   a:  r3
  1322.   b:  fr1
  1323.   c:  r4
  1324.   d:  fr2
  1325.  
  1326. according to this ABI, it is explicitly stated that parameters can be
  1327. declared in any order, and the fixed- and floating-point registers will
  1328. be used as efficiently as possible.
  1329.  
  1330. -gary j kacmarcik
  1331. platypus@cirrus.som.cwru.edu
  1332.  
  1333. +++++++++++++++++++++++++++
  1334.  
  1335. >From johnmce@world.std.com (John McEnerney)
  1336. Date: Thu, 9 Jun 1994 15:09:56 GMT
  1337. Organization: The World Public Access UNIX, Brookline, MA
  1338.  
  1339. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1340.  
  1341. >if you define something like:
  1342. >   int foo(int a,float b,int c,double d)
  1343. >the parameters will be mapped to registers as follows:
  1344. >  a:  r3
  1345. >  b:  fr1
  1346. >  c:  r4
  1347. >  d:  fr2
  1348.  
  1349. WRONG! (You would think this would be the case, but it is not)
  1350.  
  1351. a: r3
  1352. b: fr1 (r4 is reserved)
  1353. c: r5
  1354. d: fr2 (r6 and r7 are reserved)
  1355.  
  1356. additional integer arguments go in r8, etc. This is a strange nuance to 
  1357. the IBM PowerPC ABI. I believe that it is used for calling functions 
  1358. which have no prototype in scope, e.g. if I call printf() without 
  1359. including <stdio.h> (which is illegal in ANSI) the compiler will pass the 
  1360. floating-point arguments in -both- the integer and floating-point 
  1361. registers, so the callee can work correctly no matter if it takes a 
  1362. variable number of arguments or has arguments declared as floating-point 
  1363. types. Note that as the original poster pointed out, you get best results 
  1364. by declaring your integer arguments first and then your floating-point 
  1365. arguments.
  1366.  
  1367. The CodeWarrior compiler does not implement this feature, since the ANSI 
  1368. standard us strict on this issue (it is illegal to call a function taking 
  1369. a variable number of arguments without a prototype) However, for 
  1370. compatibility with the Apple Toolbox and such, we incur the same penalty 
  1371. in register usage.
  1372.  
  1373. -- John McEnerney, Metrowerks PowerPC Product Architect
  1374.  
  1375.  
  1376. +++++++++++++++++++++++++++
  1377.  
  1378. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1379. Date: Fri, 10 Jun 1994 16:45:43 +1200 (NZST)
  1380. Organization: (none)
  1381.  
  1382. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1383. > >  ... to be replaced by new nightmares such as having to remember to put all
  1384. > > floating point paramaters after all integer parameters, if you want them
  1385. > > to fit into registers :-(
  1386. > i don't know what you mean by this.  the PowerPC calling conventions that
  1387. > i'm familiar with do not require this.
  1388. > for the PowerPC, standard function calling conventions state that fixed-
  1389. > point arguments go in r3-r10, floating-point arguments go in fr1-fr13.
  1390. > if you define something like:
  1391. >    int foo(int a,float b,int c,double d)
  1392. > the parameters will be mapped to registers as follows:
  1393. >   a:  r3
  1394. >   b:  fr1
  1395. >   c:  r4
  1396. >   d:  fr2
  1397. > according to this ABI, it is explicitly stated that parameters can be
  1398. > declared in any order, and the fixed- and floating-point registers will
  1399. > be used as efficiently as possible.
  1400.  
  1401. Would that it were so!
  1402.  
  1403. Unfortunately, this directly contradicts Apple's _Inside Macintosh: PowerPC
  1404. System Software_, page 1-50:
  1405.  
  1406. "Placing a floating point parameter into a floating point register also
  1407. reserves one or two genrral-purpose registers, depending on whether the
  1408. paramater is 32 or 64 bits long.  This behavious is dictated in order to
  1409. support the ability of a C function to call another function without
  1410. knowing the number or types of the callee's parameters. [...]  The only
  1411. difference betwen cases in which the prototype is available and cases
  1412. in which the prototype isn't available is that the floating point
  1413. parameters are copied into the general-purpose register(s) in the latter
  1414. case but not in the former."
  1415.  
  1416. [there follows an example of register mapping]
  1417.  
  1418. "NOTE.  It would have been possible to pas all the fixed point values in
  1419. registers if the floating-point parameters had been grouped at the end of
  1420. the parameter list".
  1421.  
  1422.  
  1423. I would *love* to learn that this is wrong.
  1424.  
  1425. -- Bruce
  1426.  
  1427. +++++++++++++++++++++++++++
  1428.  
  1429. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1430. Date: 10 Jun 1994 20:22:51 GMT
  1431. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1432.  
  1433. In article <Cr4y4K.K57@world.std.com> johnmce@world.std.com (John McEnerney) writes:
  1434. >
  1435. > platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1436. >
  1437. > >if you define something like:
  1438. > >   int foo(int a,float b,int c,double d)
  1439. > >the parameters will be mapped to registers as follows:
  1440. > >  a:  r3
  1441. > >  b:  fr1
  1442. > >  c:  r4
  1443. > >  d:  fr2
  1444. >
  1445. > WRONG! (You would think this would be the case, but it is not)
  1446.  
  1447. i looked this up when i got home and discovered that what i was describing
  1448. was the *Embedded* ABI, which apparently has a more intelligent way
  1449. of allocating registers.  it also has things like not always generating
  1450. the (typically unused) 'param area' to shadow the GPR's on the stack - 
  1451. it only generates a param area if it's needed.
  1452.  
  1453. apparently the embedded people care more about having proper register and
  1454. stack allocation and are willing to forsake screwy calling conventions
  1455. to get it.  ;-)
  1456.  
  1457. it's funny that i never came across an example that exposed this - i guess
  1458. i don't do as much floating-point code as i thought.
  1459.  
  1460.  
  1461. -gary j kacmarcik
  1462. platypus@cirrus.som.cwru.edu
  1463.  
  1464. +++++++++++++++++++++++++++
  1465.  
  1466. >From zstern@adobe.com (Zalman Stern)
  1467. Date: Sat, 11 Jun 1994 01:30:31 GMT
  1468. Organization: Adobe Systems Incorporated
  1469.  
  1470. Gary Kacmarcik writes
  1471. > apparently the embedded people care more about having proper register and
  1472. > stack allocation and are willing to forsake screwy calling conventions
  1473. > to get it.  ;-)
  1474.  
  1475. The embedded people have the advantage of defining their calling convention  
  1476. four years later when it is obvious what you can and cannot realistically  
  1477. depend on in ANSI-C code. They are also willing to sacrifice a little more  
  1478. for performance. (I.e. portability is less of a concern in embedded code.)
  1479. --
  1480. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1481. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1482.    Never let a "final candidate" subscript get above the age of consent.
  1483.  
  1484. +++++++++++++++++++++++++++
  1485.  
  1486. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1487. Date: Sun, 12 Jun 1994 21:03:48 +1200 (NZST)
  1488. Organization: (none)
  1489.  
  1490. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1491. > i looked this up when i got home and discovered that what i was describing
  1492. > was the *Embedded* ABI, which apparently has a more intelligent way
  1493. > of allocating registers.  it also has things like not always generating
  1494. > the (typically unused) 'param area' to shadow the GPR's on the stack - 
  1495. > it only generates a param area if it's needed.
  1496. > apparently the embedded people care more about having proper register and
  1497. > stack allocation and are willing to forsake screwy calling conventions
  1498. > to get it.  ;-)
  1499. > it's funny that i never came across an example that exposed this - i guess
  1500. > i don't do as much floating-point code as i thought.
  1501.  
  1502. Agreed that it's screwy (I have to -- I'm the one that started this :-),
  1503. but there are some nice things in the PPC calling conventions as well, most
  1504. of them designed to make tiny functions extremely efficient.
  1505.  
  1506. For example, it's really nice that you can quite legally push a few things
  1507. on the stack without adjusting the stack pointer, because you can depend
  1508. on interrupt routines always skipping over the first couple of hundred
  1509. bytes of stack, in case you're using it.
  1510.  
  1511. It's also neat that a function like...
  1512.  
  1513.   long myAdd(long a, long b){return a+b;}
  1514.  
  1515. ...can be compiled into just...
  1516.  
  1517.   add r3,r3,r4
  1518.   blr
  1519.  
  1520. ...which results in no memory access at all (other than instruction
  1521. fetch).  Most 68k compilers will give even this function the full
  1522. treatment...
  1523.  
  1524.   link a6,#0
  1525.   move.l 8(a6),d0
  1526.   add.l 12(a6),d0
  1527.   unlk a6
  1528.   rts
  1529.  
  1530. ... not to mention the caller setting up the stack beforehand, and
  1531. cleaning off the parameters afterwards, causing eight memory references
  1532. in using this little function (ten for Pascal calling conventions)
  1533.  
  1534. In fact, on many code examples I've looked at, the PPC code is actually
  1535. *smaller* than the equivalent 68K code generated by the MPW or Symantec
  1536. compilers.
  1537.  
  1538. -- Bruce
  1539.  
  1540. +++++++++++++++++++++++++++
  1541.  
  1542. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1543. Date: 12 Jun 1994 18:18:31 GMT
  1544. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1545.  
  1546. In article <2854299828@hoult.actrix.gen.nz> Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1547. >
  1548. > Agreed that it's screwy (I have to -- I'm the one that started this :-),
  1549. > but there are some nice things in the PPC calling conventions as well, most
  1550. > of them designed to make tiny functions extremely efficient.
  1551. >
  1552. > For example, it's really nice that you can quite legally push a few things
  1553. > on the stack without adjusting the stack pointer, because you can depend
  1554. > on interrupt routines always skipping over the first couple of hundred
  1555. > bytes of stack, in case you're using it.
  1556.  
  1557. hmmm... i don't think that i would have chosen this particular example to
  1558. try to demonstrate why the calling conventions _weren't_ screwy.  ;-)
  1559. when i first saw IBM's compiler generating code that placed values above
  1560. the stack ptr, my first response was <ick>.
  1561.  
  1562. i can deal with it now that i understand that the compiler's trying to insure
  1563. that r1 is always pointing to a value stack frame.  one thing i wonder about
  1564. (but have yet to try) is how alloca() is handled.
  1565.  
  1566. overall, the calling conventions aren't bad and there are many advantages.
  1567. but there certainly are wierdnesses.
  1568.  
  1569.  
  1570. gary j kacmarcik
  1571. platypus@cirrus.som.cwru.edu
  1572.  
  1573. +++++++++++++++++++++++++++
  1574.  
  1575. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1576. Date: Mon, 13 Jun 1994 19:41:53 +1200 (NZST)
  1577. Organization: (none)
  1578.  
  1579. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1580. > > For example, it's really nice that you can quite legally push a few things
  1581. > > on the stack without adjusting the stack pointer, because you can depend
  1582. > > on interrupt routines always skipping over the first couple of hundred
  1583. > > bytes of stack, in case you're using it.
  1584. > hmmm... i don't think that i would have chosen this particular example to
  1585. > try to demonstrate why the calling conventions _weren't_ screwy.  ;-)
  1586. > when i first saw IBM's compiler generating code that placed values above
  1587. > the stack ptr, my first response was <ick>.
  1588. > i can deal with it now that i understand that the compiler's trying to insure
  1589. > that r1 is always pointing to a value stack frame.  one thing i wonder about
  1590. > (but have yet to try) is how alloca() is handled.
  1591. > overall, the calling conventions aren't bad and there are many advantages.
  1592. > but there certainly are wierdnesses.
  1593.  
  1594. The way I look at it is that most of this stuff has been designed to be
  1595. fast running, even if it make life hell for the asm programmer trying to
  1596. keep track of things manually.  That, after all, being what compilers
  1597. are for.
  1598.  
  1599. -- Bruce
  1600.  
  1601. ---------------------------
  1602.  
  1603. >From rang@winternet.com (Anton Rang)
  1604. Subject: PPC and 64-bit video (was Re: Fast full screen scrolling: impossible?)
  1605. Date: 13 Jun 1994 02:33:06 GMT
  1606. Organization: Minnesota Angsters
  1607.  
  1608. In article <1994Jun12.182803.1@west.cscwc.pima.edu> 103t_english@west.cscwc.pima.edu writes:
  1609. >d e v e l o p 18 claims that the PPC blitter that they used was slower than
  1610. >CopyBits because it didn't (presumably, for some unknown reason, *couldn't*)
  1611. >take advantage of the 64-bit path of video.
  1612.  
  1613.   Unless you're using the floating-point registers, you can't use the
  1614. full 64-bit path efficiently, because there's no 64-bit integer load.
  1615. I haven't looked at NQDCopyBits to see if it uses the FP registers; I
  1616. suppose that it *could*, in cases where there is no scaling, shifting,
  1617. etc. but it seems unlikely that it would.
  1618.  
  1619. >For this same reason, *BlockMove* was also slower.
  1620.  
  1621.   Well, BlockMove is going to be slower on the PPC because the video
  1622. memory is noncachable and BlockMove will pre-zero it using the dcbz
  1623. instruction ('zero-cache-block').  Using dcbz is a big win when doing
  1624. copies between cachable blocks, because it eliminates the pre-read
  1625. that the processor will otherwise do when storing data.
  1626.  
  1627.   The Power Macintosh NuBus technical note addresses this, and
  1628. includes a new interface, PBBlockMove, which is supposed to take into
  1629. account the cachability of source and destination memory ranges.  (No
  1630. word on when this will be shipping or whether it will be licensable as
  1631. a system extension.)
  1632.  
  1633. >What is going on with the memory subsystem in the PowerMacs? Is it or isn't it
  1634. >64-bit? Is the DRAM video 64-bit? Is the AV video? Is the non-AV PDS video?
  1635.  
  1636.   The non-AV PDS VRAM is 64-bit, the DRAM is 64-bit (all of memory
  1637. is).  The AV bus internally is 32-bits (it's the same chips as on the
  1638. 680x0 AVs), but might have a 64-bit interface to the processor bus; I
  1639. haven't looked.
  1640.  
  1641. > [ questions about video bandwidth deleted, i have no answers ]
  1642. >For that matter, why can't BlockMove move data in 64-bit chunks when
  1643. >it is most optimal to do so?
  1644.  
  1645.   It can.  The problem is the dcbz, which when used with video memory
  1646. will result in every word being written twice.  That's why you should
  1647. use CopyBits instead.  :-)
  1648.  
  1649. >And finally, what happened to the load/store multiple instructions
  1650. >that are (I assume?) faster on the 601, but will probably be slower
  1651. >"in future implementations?"
  1652.  
  1653.   They're actually not faster on the 601, they simply take less code
  1654. space.  They still take one cycle per register to process.  I haven't
  1655. checked to see whether they're slower on the 603/604, but would guess
  1656. that they may cause synchronization on the 603, which would certainly
  1657. slow things down relative to just using plain load/store.
  1658.  
  1659.   The fastest way to move memory on the 601 is to use floating-point
  1660. registers (load/store double), coupled with 'dcbz' if you're going to
  1661. cachable memory, but *not* when you're going to non-cachable memory.
  1662. (All of this presumes aligned memory, incidentally; if you're not
  1663. aligned, you're out of luck and probably need to use the string
  1664. instructions instead.)
  1665. --
  1666. Anton Rang (rang@winternet.com)
  1667.  
  1668. ---------------------------
  1669.  
  1670. >From Frank Manshande <frankm@and.nl>
  1671. Subject: Playing QuickTime movies
  1672. Date: Mon, 6 Jun 1994 11:41:21 GMT
  1673. Organization: AND Software BV
  1674.  
  1675. Hi,
  1676.  
  1677. I have a question concerning playing QuickTime movies.
  1678.  
  1679. What I want is to store the movie (data) into the datafork at
  1680. a specific offset (for example at offset 3000), and later play
  1681. that movie from that offset. This way I can put more than one
  1682. QuickTime movie into one file and play a movie at a specific
  1683. offset.
  1684.  
  1685. The call "PutMovieIntoDataFork" only seems to store the movie
  1686. structure, and not the movie data, into a file at the specified
  1687. offset. This way the PutMovieIntoDataFork call creates a file
  1688. of about 1,5 KB which only contains a reference to the original
  1689. movie data file.
  1690.  
  1691. Does anybody have suggestions? I would be very grateful!
  1692.  
  1693. Frank Manshande
  1694. frankm@and.nl
  1695.  
  1696. +++++++++++++++++++++++++++
  1697.  
  1698. >From breger@netcom.com (Ron Breger)
  1699. Date: Mon, 6 Jun 1994 17:49:45 GMT
  1700. Organization: Netcom
  1701.  
  1702. Frank Manshande (frankm@and.nl) wrote:
  1703. : Hi,
  1704.  
  1705. : I have a question concerning playing QuickTime movies.
  1706.  
  1707. : What I want is to store the movie (data) into the datafork at
  1708. : a specific offset (for example at offset 3000), and later play
  1709. : that movie from that offset. This way I can put more than one
  1710. : QuickTime movie into one file and play a movie at a specific
  1711. : offset.
  1712.  
  1713. : The call "PutMovieIntoDataFork" only seems to store the movie
  1714. : structure, and not the movie data, into a file at the specified
  1715. : offset. This way the PutMovieIntoDataFork call creates a file
  1716. : of about 1,5 KB which only contains a reference to the original
  1717. : movie data file.
  1718.  
  1719. I am having the same problem, but I am using handles.
  1720. This is something that I'm trying to do:
  1721.  
  1722.  
  1723. // save the moive
  1724. PutMoiveIntoHandle()
  1725. AddResource(publicMoive, 'MRES', 1000, "");
  1726. ReleaseResource(publicMovie);
  1727.  
  1728. then
  1729.  
  1730. // play the movie
  1731. publicMovie = GetResource('MRES',1000);
  1732. DetachResource(publicMoive);
  1733. StartMoive(publicMoive);
  1734.  
  1735.  
  1736. I would like to have one (resource) file to contain many movies.
  1737. I don't want to use MovieFiles.  I would like the data
  1738. to be in a resource and not contain any references to
  1739. the original files.  Is this possible?
  1740.  
  1741. Please help.  (email or post).
  1742.  
  1743. Thanks.
  1744. Ron Breger
  1745.  
  1746. -- 
  1747. =====================================================================
  1748. Ron Breger         
  1749. breger@netcom.com                              AppleLink: RON.BREGER
  1750. =====================================================================
  1751.  
  1752. +++++++++++++++++++++++++++
  1753.  
  1754. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1755. Date: Mon, 6 Jun 1994 20:27:32 GMT
  1756. Organization: The World Public Access UNIX, Brookline, MA
  1757.  
  1758. breger@netcom.com (Ron Breger) writes:
  1759. >Frank Manshande (frankm@and.nl) wrote:
  1760. >: Hi,
  1761. >: I have a question concerning playing QuickTime movies.
  1762. >: What I want is to store the movie (data) into the datafork at
  1763. >: a specific offset (for example at offset 3000), and later play
  1764. >: that movie from that offset. This way I can put more than one
  1765. >: QuickTime movie into one file and play a movie at a specific
  1766. >: offset.
  1767.  
  1768. FlattenMovieData to a temp file, then copy the data over, using
  1769. SetMediaDataRef to repoint all the medias in the movie to the new file.
  1770.  
  1771. >I am having the same problem, but I am using handles.
  1772. >This is something that I'm trying to do:
  1773.  
  1774. >// save the moive
  1775. >PutMoiveIntoHandle()
  1776. >AddResource(publicMoive, 'MRES', 1000, "");
  1777. >ReleaseResource(publicMovie);
  1778.  
  1779. This would work in theory; however, you should do a WriteResource
  1780. before you do a ReleaseResource. Is there a reason why you're not using
  1781. Add/UpdateMovieResource, however?
  1782.  
  1783. >then
  1784.  
  1785. >// play the movie
  1786. >publicMovie = GetResource('MRES',1000);
  1787. >DetachResource(publicMoive);
  1788. >StartMoive(publicMoive);
  1789.  
  1790. This will *not* work. You'd have to do:
  1791.     myMovie = NewMovieFromHandle(publicMovie);
  1792.  
  1793. >I would like to have one (resource) file to contain many movies.
  1794.  
  1795. Perfectly feasible with Add/UpdateMovieResource, since you can specify
  1796. the resID, as well as scan the movie res file for 'moov' resources.
  1797.  
  1798. >I don't want to use MovieFiles.
  1799.  
  1800. Why? Are there limitations you see in using them?
  1801.  
  1802. >  I would like the data
  1803. >to be in a resource and not contain any references to
  1804. >the original files.  Is this possible?
  1805.  
  1806. Nope. The movie *data* must be in a data fork. It *is* possible for the
  1807. file to be completely self-contained (ie all the movie data would be in
  1808. the data fork of the file that contains the movie resources), however.
  1809.  
  1810. -Ivan
  1811. - -
  1812. Ivan Cavero Belaunde (ivanski@world.std.com)
  1813. Avid VideoShop Project Lead
  1814. Avid Technology, Inc.
  1815.  
  1816. +++++++++++++++++++++++++++
  1817.  
  1818. >From Frank Manshande <frankm@and.nl>
  1819. Date: Tue, 7 Jun 1994 07:29:44 GMT
  1820. Organization: AND Software BV
  1821.  
  1822. In article <Cqzstw.BqE@world.std.com> Ivan M CaveroBelaunde,
  1823. ivanski@world.std.com writes:
  1824. >FlattenMovieData to a temp file, then copy the data over, using
  1825. >SetMediaDataRef to repoint all the medias in the movie to the new file.
  1826. >
  1827.  
  1828. I'm reading IM-QuickTime right now, but I can't seem to find how I can
  1829. play a movie from a specific offset. If I succeed in saving the movie
  1830. the way you describe, using SetMediaDataRef for all the tracks, how can
  1831. I then play that movie. And would that also work under QuickTime for
  1832. Windows?
  1833.  
  1834. Thanks for your time!
  1835.  
  1836. Frank Manshande
  1837. frankm@and.nl
  1838.  
  1839. +++++++++++++++++++++++++++
  1840.  
  1841. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1842. Date: Tue, 7 Jun 1994 13:50:44 GMT
  1843. Organization: The World Public Access UNIX, Brookline, MA
  1844.  
  1845. Frank Manshande <frankm@and.nl> writes:
  1846.  
  1847. >In article <Cqzstw.BqE@world.std.com> Ivan M CaveroBelaunde,
  1848. >ivanski@world.std.com writes:
  1849. >>FlattenMovieData to a temp file, then copy the data over, using
  1850. >>SetMediaDataRef to repoint all the medias in the movie to the new file.
  1851. >>
  1852.  
  1853. >I'm reading IM-QuickTime right now, but I can't seem to find how I can
  1854. >play a movie from a specific offset. If I succeed in saving the movie
  1855. >the way you describe, using SetMediaDataRef for all the tracks, how can
  1856. >I then play that movie. And would that also work under QuickTime for
  1857. >Windows?
  1858.  
  1859. The way you would play that movie is that you would, in that same file,
  1860. store multiple movie resources for each of the movies stored at different
  1861. offsets using Add/UpdateMovieResource. Then you can just do
  1862. NewMovieFromFile/FromHandle and play whichever one you want.
  1863.  
  1864. This does *not* work at all under QuickTime for Windows, since QTW
  1865. uses data-fork only movies. Since df movies are defined to contain
  1866. its "movie resource" at the end of the data stream, you can only
  1867. have *one* movie per file, unlike the flexibility you have when you
  1868. use moov resources.
  1869.  
  1870. QTW has a number of other limitations you might want to read up on. I don't
  1871. remember them off the top of my head, but, for exmaple, I don't believe
  1872. multitrack or multifile (dependent file) support is in there yet - you're
  1873. limited to comlletely self-contained movies with at most 1 video track and
  1874. 1 audio track.
  1875.  
  1876. -Ivan
  1877. - -
  1878. Ivan Cavero Belaunde (ivanski@world.std.com)
  1879. Avid VideoShop Project Lead
  1880. Avid Technology, Inc.
  1881.  
  1882. +++++++++++++++++++++++++++
  1883.  
  1884. >From breger@netcom.com (Ron Breger)
  1885. Date: Wed, 8 Jun 1994 15:39:47 GMT
  1886. Organization: Netcom
  1887.  
  1888. : >I am having the same problem, but I am using handles.
  1889. : >This is something that I'm trying to do:
  1890.  
  1891. : >// save the moive
  1892. : >PutMoiveIntoHandle()
  1893. : >AddResource(publicMoive, 'MRES', 1000, "");
  1894. : >ReleaseResource(publicMovie);
  1895.  I did the WriteResource.
  1896.  
  1897.  
  1898. : This would work in theory; however, you should do a WriteResource
  1899. : before you do a ReleaseResource. Is there a reason why you're not using
  1900. : Add/UpdateMovieResource, however?
  1901.  
  1902. : >then
  1903.  
  1904. : >// play the movie
  1905. : >publicMovie = GetResource('MRES',1000);
  1906. : >DetachResource(publicMoive);
  1907. : >StartMoive(publicMoive);
  1908.  
  1909. : This will *not* work. You'd have to do:
  1910. :     myMovie = NewMovieFromHandle(publicMovie);
  1911.  
  1912. Yes, I am doing the NewMovieFromHandle.
  1913.  
  1914. : Perfectly feasible with Add/UpdateMovieResource, since you can specify
  1915. : the resID, as well as scan the movie res file for 'moov' resources.
  1916.  
  1917. : >I don't want to use MovieFiles.
  1918.  
  1919. : Why? Are there limitations you see in using them?
  1920.  
  1921. I want to use my own resources instead of MovieFiles, so that I can
  1922. put all the movies in regular resource files and use ResEdit to copy
  1923. and paste the movies I need.  Also, I would like to have my application
  1924. contain all the resources it needs and not have it depend on any
  1925. other files.  
  1926.  
  1927. I am planning of using QuickTime 2.0 that supports Music (MIDI) and
  1928. would like to have all of the Movies be in the resource fork of the 
  1929. application.  I find it very convienient to be able to use ResEdit
  1930. to copy/paste resources around.  So, I was trying to have a movie
  1931. be self-contained, storing the movie as a resource, and reading it
  1932. back in using GetResource() and NewMoiveFromHandle(), but have been
  1933. unsuccessful.  I still am a little confused why this doesn't work:
  1934.  
  1935. AddResource(publicMoive, 'MRES', 1000, "");
  1936. WriteResource(publicMovie);
  1937. ReleaseResource(publicMovie);
  1938.  
  1939. [I don't want to use AddMoiveResource(), as I don't want to use
  1940. MoiveFiles().  I want all the data to be in one resource and not use
  1941. the data fork.  That way, I can use ResEdit to eaisly copy/paste 
  1942. movies around.  This is what I do with my 'snd ' resources!] 
  1943.  
  1944. then
  1945.  
  1946. // play the movie
  1947. publicMovie = GetResource('MRES',1000);
  1948. DetachResource(publicMoive);
  1949. NewMovieFromHandle(&theMovie, publicMovie);
  1950. StartMoive(theMoive);
  1951.  
  1952. Thanks for all your help.
  1953. -- 
  1954. =====================================================================
  1955. Ron Breger         
  1956. breger@netcom.com                              AppleLink: RON.BREGER
  1957. =====================================================================
  1958.  
  1959. +++++++++++++++++++++++++++
  1960.  
  1961. >From jywang@apple.com (John Wang)
  1962. Date: 9 Jun 1994 21:37:17 GMT
  1963. Organization: Apple Computer, Inc.
  1964.  
  1965. There are two parts to a movie.  1) the movie data atom.  2) the movie
  1966. resource atom.  The movie data atom is always in the data fork.   However,
  1967. the movie resource atom can be stored in either the resource fork or the
  1968. data fork.  If the movie resource atom is stored in the resource fork, it
  1969. is very easy to randomly access the many atoms that you might have stored
  1970. in individual resources.  But, if you want your movies to be cross-platform
  1971. compatible, then you'll want to stored the movie resource atoms in the data
  1972. fork.
  1973.  
  1974. To store the movie data atom into a file, you must call either FlattenMovie
  1975. or FlattenMovieData.  The difference between FlattenMovie and FlattenMovie
  1976. is that FlattenMovie also adds the movie resource atom to the resource
  1977. fork.  Therefore, you'll want to call FlattenMovieData if you don't want to
  1978. add a movie resource atom to the resource fork.  Instead, in either call,
  1979. you can use the flag, flattenAddMovieToDataFork.  This will add the movie
  1980. resource atom to the data fork.
  1981.  
  1982. For a more complete discussion of this topic, please read my column on
  1983. "Movie Files" in issue #16 of develop magazine (an Apple publication).
  1984.  
  1985. John Wang
  1986.  
  1987. In article <bregerCqzLIx.GEp@netcom.com>, breger@netcom.com (Ron Breger)
  1988. wrote:
  1989.  
  1990. > Frank Manshande (frankm@and.nl) wrote:
  1991. > : Hi,
  1992. > : I have a question concerning playing QuickTime movies.
  1993. > : What I want is to store the movie (data) into the datafork at
  1994. > : a specific offset (for example at offset 3000), and later play
  1995. > : that movie from that offset. This way I can put more than one
  1996. > : QuickTime movie into one file and play a movie at a specific
  1997. > : offset.
  1998. > : The call "PutMovieIntoDataFork" only seems to store the movie
  1999. > : structure, and not the movie data, into a file at the specified
  2000. > : offset. This way the PutMovieIntoDataFork call creates a file
  2001. > : of about 1,5 KB which only contains a reference to the original
  2002. > : movie data file.
  2003. > I am having the same problem, but I am using handles.
  2004. > This is something that I'm trying to do:
  2005. > // save the moive
  2006. > PutMoiveIntoHandle()
  2007. > AddResource(publicMoive, 'MRES', 1000, "");
  2008. > ReleaseResource(publicMovie);
  2009. > then
  2010. > // play the movie
  2011. > publicMovie = GetResource('MRES',1000);
  2012. > DetachResource(publicMoive);
  2013. > StartMoive(publicMoive);
  2014. > I would like to have one (resource) file to contain many movies.
  2015. > I don't want to use MovieFiles.  I would like the data
  2016. > to be in a resource and not contain any references to
  2017. > the original files.  Is this possible?
  2018. > Please help.  (email or post).
  2019. > Thanks.
  2020. > Ron Breger
  2021. > -- 
  2022. > =====================================================================
  2023. > Ron Breger         
  2024. > breger@netcom.com                              AppleLink: RON.BREGER
  2025. > =====================================================================
  2026.  
  2027. +++++++++++++++++++++++++++
  2028.  
  2029. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  2030. Date: Mon, 13 Jun 1994 21:56:13 GMT
  2031. Organization: The World Public Access UNIX, Brookline, MA
  2032.  
  2033. breger@netcom.com (Ron Breger) writes:
  2034. >I want to use my own resources instead of MovieFiles, so that I can
  2035. >put all the movies in regular resource files and use ResEdit to copy
  2036. >and paste the movies I need.  Also, I would like to have my application
  2037. >contain all the resources it needs and not have it depend on any
  2038. >other files.  
  2039.  
  2040. QT usually *needs* to store movie data in the data fork of files. QT2
  2041. introduces a "handle data handler," which allows you to create movies
  2042. that are held entirely in memory. (Maynard Handley will like this...)
  2043. The twist is, of course, that you have to save them yourself somehow
  2044. (the movie user data could be the place for it).
  2045.  
  2046. So the movie creation process goes as follows:
  2047.   - Create the movie the usual way, putting the data in the data fork.
  2048.   - After you're done, make a copy of the movie by copying each
  2049.      track by hand (using InsertTrackSegment). However, on the
  2050.      copied movie, when you create the media, specify that you're
  2051.      using the handle data handler instead of the alias data
  2052.      handler. This will create an in-memory copy of the
  2053.      movie data.
  2054.   - Save the handles where the data is sitting in the movie's user
  2055.      data using AddUserData.
  2056.   - Do the PutMovieIntoHandle, etc, stuff and save the movie as a
  2057.      resource.
  2058.  
  2059. Once you've done that once, you can load the movie by doing the following:
  2060.   - GetResource()
  2061.   - NewMovieFromHandle()
  2062.   - GetMovieUserData()
  2063.   - For every track in this movie, if the media type is 'hndl',
  2064.          use the SetMediaDataRef call to "repoint" the media
  2065.          to the handle from GetMovieUserData.
  2066.  
  2067. Although I haven't tried this specifically, I've used all of these calls
  2068. at one time or another, so it should work.
  2069.  
  2070. The downside to this trick is that you end up with two copies of the
  2071. data in memory, which for large movies would be a serious issue.
  2072. That can be addressed by putting the data handle in a separate resource
  2073. instead of the user data, but the drawback there is that you must
  2074. copy two resources around, which might or might not be a big deal.
  2075. You could still use the movie user data to specify the res type and id
  2076. where the data is stored.
  2077.  
  2078. Hope this helps,
  2079.  
  2080. -Ivan
  2081. - -
  2082. Ivan Cavero Belaunde (ivanski@world.std.com)
  2083. Avid VideoShop Project Lead
  2084. Avid Technology, Inc.
  2085. #include <std.disclaimer.h>
  2086.  
  2087. ---------------------------
  2088.  
  2089. >From nagle@netcom.com (John Nagle)
  2090. Subject: Quickdraw GX - Why?
  2091. Date: Mon, 30 May 1994 03:46:07 GMT
  2092. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  2093.  
  2094.       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2095. graphics system.  This is nice, but does it solve a real problem?
  2096. It's not a full 3D system, so you can't use it for 3D graphics.
  2097. It's not compatible with existing object-oriented graphics standards, 
  2098. like X or PHIGS.  It's complicated; several volume of manuals are required.
  2099. Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2100. achieve that.  What kind of application would be simpler if written to use
  2101. Quickdraw GX?  
  2102.  
  2103.                     John Nagle
  2104.  
  2105. +++++++++++++++++++++++++++
  2106.  
  2107. >From opstad@apple.com (David Opstad)
  2108. Date: 29 May 1994 22:01:29 -0700
  2109. Organization: Apple Computer Inc, Cupertino, CA
  2110.  
  2111. In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2112. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2113. >graphics system.  This is nice, but does it solve a real problem?
  2114. >It's not a full 3D system, so you can't use it for 3D graphics.
  2115. >It's not compatible with existing object-oriented graphics standards, 
  2116. >like X or PHIGS.  It's complicated; several volume of manuals are required.
  2117. >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2118. >achieve that.  What kind of application would be simpler if written to use
  2119. >Quickdraw GX?  
  2120.  
  2121. A word processing or page layout app would be much simpler using GX, since the
  2122. typographic expressiveness built into GX is very great. An application that
  2123. wishes to print to multiple kinds of paper in the same job (portrait and
  2124. landscape, say, or throw in an envelope too) has an easy road using GX printing.
  2125. Printing transfer modes (including to PostScript (TM) printers) that you
  2126. couldn't used to print is now possible with GX. Having pictures that are both
  2127. parsable and able to themselves contain pictures makes for much easier handling
  2128. of whole trees of image data to be rendered. And so on...
  2129.  
  2130. GX definitely isn't just for 2D graphics. Of course, your points about 3D are
  2131. well-taken, but that wasn't the problem that GX was intended to solve. For
  2132. years, developers for apps on the Mac have had to put up with a lot of quirks
  2133. in the way that QuickDraw forced them to deal with device-dependent graphics,
  2134. and with printing that also had its share of strange hackishness. GX finally
  2135. fixes many of these problems.
  2136.  
  2137. Dave Opstad
  2138. GX Line Layout Weenie
  2139.  
  2140. +++++++++++++++++++++++++++
  2141.  
  2142. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  2143. Date: 30 May 1994 07:43:14 GMT
  2144. Organization: The Royal Institute of Technology
  2145.  
  2146. In <nagleCqLJsw.MvI@netcom.com> nagle@netcom.com (John Nagle) writes:
  2147.  
  2148. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2149. >graphics system.  This is nice, but does it solve a real problem?
  2150.  
  2151. Yes.
  2152.  
  2153. >It's not compatible with existing object-oriented graphics standards, 
  2154. >like X or PHIGS.
  2155.  
  2156. 1) X is not object oriented; it's QuickDraw where the bottlenecks
  2157.    go through a network driver.
  2158. 2) PHIGS is a 3D library.
  2159.  
  2160. >It's complicated; several volume of manuals are required.
  2161.  
  2162. Would you rahter it was less capable? The documentation for QDGX is
  2163. quite good to my meaning, what's missing is a lot of sample code (there
  2164. is some at least) and support in our frameworks of choise.
  2165.  
  2166. >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2167. >achieve that.  What kind of application would be simpler if written to use
  2168. >Quickdraw GX?  
  2169.  
  2170. QuickDraw GX printing is not a, but SEVERAL steps up, and re-defines
  2171. desktop printing. It shoots Apple ahead of the competition.
  2172.  
  2173. The GX imaging model has several things going for it, both in simplicity
  2174. and capability. You can write a capable draw program with much less effort
  2175. than before. You can expect to see shareware programs going after the
  2176. Illustrator and FreeHand crowd!
  2177.  
  2178. It's also _much_more_capable_ with ligatures, special forms and kerning
  2179. handled automatically, as well as providing very good typographic control
  2180. ("Gunk" and "Funk" axes, anyone? :-)
  2181.  
  2182. If you can't see the use of this to create more beautiful documents,
  2183. you're positioned where one-font-only people were in the middle of
  2184. the 80s.
  2185.  
  2186. Cheers,
  2187.  
  2188.                     / h+
  2189. -- 
  2190.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  2191.  Engineering: "How will this work?" Science: "Why will this work?" Management:
  2192.  "When will this work?"  Liberal Arts: "Do you want fries with that?"
  2193.                      -- Jesse N. Schell
  2194.  
  2195. +++++++++++++++++++++++++++
  2196.  
  2197. >From dank@alumni.caltech.edu (Daniel R. Kegel)
  2198. Date: 30 May 1994 07:55:28 GMT
  2199. Organization: California Institute of Technology, Pasadena
  2200.  
  2201. In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2202. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2203. >graphics system.  This is nice, but does it solve a real problem?
  2204.  
  2205. Quickdraw GX supports Unicode, which means that software
  2206. will be easier to internationalize.  Although the application developer
  2207. still needs to worry about different character sets when talking to
  2208. the outside world, inside everything can be Unicode.  This makes document
  2209. exchange and maintenance easier in a multilingual environment.
  2210. - Dan
  2211.  
  2212. +++++++++++++++++++++++++++
  2213.  
  2214. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  2215. Date: Mon, 30 May 94 09:58:47 PST
  2216. Organization: Peirce Software, Inc.
  2217.  
  2218.  
  2219. In article <nagleCqLJsw.MvI@netcom.com> (comp.sys.mac.programmer), nagle@netcom.com (John Nagle) writes:
  2220. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2221. > graphics system.  This is nice, but does it solve a real problem?
  2222. > It's not a full 3D system, so you can't use it for 3D graphics.
  2223. > It's not compatible with existing object-oriented graphics standards, 
  2224. > like X or PHIGS.  It's complicated; several volume of manuals are required.
  2225. > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2226. > achieve that.  What kind of application would be simpler if written to use
  2227. > Quickdraw GX?  
  2228.  
  2229. For me the two most important parts of QuickDraw GX aren't specific
  2230. to it's graphics engine: Typography and Printing.
  2231.  
  2232. QuickDraw GX typography brings truly great type handling to "normal"
  2233. programs with the line layout manager.  No longer will this be limited
  2234. to page layout programs.  Related is the new font technology: support
  2235. for TrueType GX and Type 1 multi master fonts.  These fonts allow
  2236. for smarts to be put directly into the font to do things that wasn't
  2237. possible before.
  2238.  
  2239. QuickDraw GX printing finally remakes the printing user interface.
  2240. Switching printers at print dialog time, desktop printers that allow
  2241. users to move a print job from one printer to another, and much better
  2242. support for paper types are just three examples of making the printing
  2243. experience for the user much simplier, yet more powerful.
  2244.  
  2245. Another key benefit for users is that GX pictures don't have any of
  2246. the horrible 72-dpi problems that you run into with PICTs.  And Portable
  2247. Digital Documents extend this idea so that a user can create a PPD
  2248. and not wworry about not having the right font if they try to print
  2249. or view it on another system.
  2250.  
  2251. I could go on, but you get my drift.
  2252.  
  2253. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  2254. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  2255. __                       __ San Jose, California USA 95117-1844
  2256. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  2257. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  2258.  
  2259. +++++++++++++++++++++++++++
  2260.  
  2261. >From usenet@lowry.eche.ualberta.ca (Brian Lowry)
  2262. Date: 30 May 1994 21:05:13 GMT
  2263. Organization: Dept. of Chemical Eng., University of Alberta
  2264.  
  2265. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle)
  2266. wrote:
  2267.  
  2268. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2269. > graphics system.  This is nice, but does it solve a real problem?
  2270.  
  2271.   Yes, by expressing coordinates as fixed point numbers instead of
  2272. integers.  That alone is enough to recommend it.
  2273.  
  2274. -- 
  2275.  
  2276. Brian Lowry
  2277.  
  2278. +++++++++++++++++++++++++++
  2279.  
  2280. >From AppleGG@lamg.com (Gordon Apple)
  2281. Date: 30 May 1994 21:54:19 -0000
  2282. Organization: Los Angeles Macintosh Group BBS
  2283.  
  2284. > Yes, by expressing coordinates as fixed point numbers instead of
  2285. >integers.  That alone is enough to recommend it.
  2286.  
  2287.  
  2288.      I think it's ironic that Quickdraw GX went to such lengths (i.e.,
  2289. "Fixed" format) to avoid floating point operations, and is being released
  2290. almost simultaneously with the switch to PowerPC processors that run blazing
  2291. fast floating point that would have been faster than using "Fixed".
  2292.  
  2293. +++++++++++++++++++++++++++
  2294.  
  2295. >From dowdy@apple.com (Tom Dowdy)
  2296. Date: Tue, 31 May 1994 17:06:52 GMT
  2297. Organization: Apple Computer, Inc.
  2298.  
  2299. In article <CNjbKKKX.0uqam3@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org
  2300. (Michael Peirce) wrote:
  2301.  
  2302. > In article <nagleCqLJsw.MvI@netcom.com> (comp.sys.mac.programmer), nagle@netcom.com (John Nagle) writes:
  2303. > >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2304. > > graphics system.  This is nice, but does it solve a real problem?
  2305. > > It's not a full 3D system, so you can't use it for 3D graphics.
  2306. > > It's not compatible with existing object-oriented graphics standards, 
  2307. > > like X or PHIGS.  It's complicated; several volume of manuals are required.
  2308. > > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2309. > > achieve that.  What kind of application would be simpler if written to use
  2310. > > Quickdraw GX?  
  2311. > For me the two most important parts of QuickDraw GX aren't specific
  2312. > to it's graphics engine: Typography and Printing.
  2313.  
  2314. Michael mentions several nice things about these two areas, and
  2315. one nice thing about graphics (the no-72 dpi picture thingie).
  2316.  
  2317. I'd like to mention several other "nice graphics thingies" just
  2318. to give that part of GX even time.
  2319.  
  2320.  - rotation of all objects (everyone asks, so I call it out)
  2321.  
  2322.  - 3X3 transformation matricies (including perspective)
  2323.  
  2324.  - area, length, and other geometric information routines
  2325.  
  2326.  - full geometry engine, letting you hit test, subdivide, and
  2327.    intersect (via any boolean operator that makes sense) any two
  2328.    shapes and get a device-independant GEOMETRY out the other side.
  2329.    No other general purpose graphics system has this, and it lets you
  2330.    do some excellent things, such as creating shapes from other
  2331.    shapes in a drawing package.  (I personally think this area
  2332.    is very exciting, as I'd love to be able to SUBTRACT from
  2333.    one shape to create masks and such).
  2334.  
  2335.  - VERY powerful transfer mode functionality (and it all prints to
  2336.    everything, including PostScript).
  2337.  
  2338.  - device and space independant color, allowing you to create
  2339.    objects in any color space you feel comfortable with, and have
  2340.    the graphics system worry about the translation
  2341.  
  2342.  - curves
  2343.  
  2344.  - shape tagging, which lets you attach information or hints
  2345.    that are of use to either you or the system to shapes and pictures.
  2346.    (and also lets us extend GX in the future without the need to
  2347.    rev existing applications)
  2348.  
  2349.  - pictures can be "walked" or edited without the need to replay them
  2350.    to do so.
  2351.  
  2352. GX is lots of books.  But the API is really well thought out, and
  2353. once you start using it, you'll find that most API calls make sense
  2354. and you can figure them out by "guessing" the name.  
  2355.  
  2356. ob funny: when the PrintShop first started working with the GX graphics
  2357. system, we liked to "make up" fake API calls by combining the logical
  2358. flow of the API into nonsense API calls that sounded useful:
  2359.  GXGetTransformViewPortMappingStyle()
  2360.  GXSetMappingInk()
  2361.  
  2362.  
  2363. -- 
  2364.  Tom Dowdy                  Internet: dowdy@apple.COM
  2365.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  2366.  1 Infinite Loop            AppleLink: DOWDY1
  2367.  Cupertino, CA 95014       
  2368.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  2369.  
  2370. +++++++++++++++++++++++++++
  2371.  
  2372. >From dowdy@apple.com (Tom Dowdy)
  2373. Date: Tue, 31 May 1994 17:11:45 GMT
  2374. Organization: Apple Computer, Inc.
  2375.  
  2376. In article <2sbrv9$t5f@apple.com>, opstad@apple.com (David Opstad) wrote:
  2377.  
  2378. > In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2379. > >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2380. > >graphics system.  This is nice, but does it solve a real problem?
  2381. > >It's not a full 3D system, so you can't use it for 3D graphics.
  2382. > >It's not compatible with existing object-oriented graphics standards, 
  2383. > >like X or PHIGS.  It's complicated; several volume of manuals are required.
  2384. > >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2385. > >achieve that.  What kind of application would be simpler if written to use
  2386. > >Quickdraw GX?  
  2387. > A word processing or page layout app would be much simpler using GX, since the
  2388. > typographic expressiveness built into GX is very great. 
  2389.  
  2390. One thing Dave didn't mention is that at the WWDC during the type
  2391. demo we showed a sample application using GX and its rich text to create
  2392. page layouts.  The application does multiple collumns, wraps text
  2393. around objects (using the cool GX geometry engine), and flows across
  2394. multiple pages.  It prints (and we've used to it to create some
  2395. cool party invites here!), saves, and can handle custom page setups
  2396. (doesn't yet do multiple formats).
  2397.  
  2398. Except for all of the "app stuff" like clipboard, typing,
  2399. cut and paste, undo, etc -- it's pretty much fully functional.
  2400.  
  2401. It's 50K of compiled code.  Something I think is quite impressive --
  2402. and the savings comes from thinking in a GX world where the system
  2403. handles more of the work for you.
  2404.  
  2405. -- 
  2406.  Tom Dowdy                  Internet: dowdy@apple.COM
  2407.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  2408.  1 Infinite Loop            AppleLink: DOWDY1
  2409.  Cupertino, CA 95014       
  2410.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  2411.  
  2412. +++++++++++++++++++++++++++
  2413.  
  2414. >From jwbaxter@olympus.net (John W. Baxter)
  2415. Date: Tue, 31 May 1994 13:02:27 -0700
  2416. Organization: Internet for the Olympic Peninsula
  2417.  
  2418. In article <dowdy-310594095217@17.202.68.12>, dowdy@apple.com (Tom Dowdy)
  2419. wrote:
  2420.  
  2421. > GX is lots of [Inside Macintosh} books.  But the API is really well thought
  2422. > out, and
  2423. > once you start using it, you'll find that most API calls make sense
  2424. > and you can figure them out by "guessing" the name.  
  2425.  
  2426. Tom...I fully agree.  You and friends did very well.
  2427.  
  2428. -- 
  2429. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  2430.    jwbaxter@pt.olympus.net
  2431.  
  2432. +++++++++++++++++++++++++++
  2433.  
  2434. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  2435. Date: Tue, 31 May 1994 22:00:32 GMT
  2436. Organization: Apple Computer
  2437.  
  2438. John Nagle, nagle@netcom.com writes:
  2439. > What kind of application would be simpler if written to use
  2440. > Quickdraw GX?  
  2441.  
  2442. Any kind of illustration program a la Illustrator or FreeHand or Canvas. GX
  2443. makes it very easy to write such programs, since it does so much work for
  2444. you: not only does it support powerful graphics primitives like quadric
  2445. Beziers, fancy options like dashes and joins, and really sophisticated color
  2446. models, but it also makes it very easy to manipulate these objects.
  2447. Hit-testing any GX objects (including type) is mostly just a matter of one
  2448. call.
  2449.  
  2450. Whether the big guns like Aldubeus or Deneba will move over to GX is unclear;
  2451. after all, they've already got code to do most of this stuff. But remember
  2452. how after 32-bit QuickDraw appeared we started to get some good color paint
  2453. programs from smaller developers that were cheap and reasonably powerful for
  2454. mere mortals? That's because 32BQD made it so much easier to do offscreen
  2455. color graphics. I think GX will have the same effect on illustration and
  2456. typography software, since it makes it possible to do very powerful
  2457. PostScript-style (and more!) graphics without requiring you to write your own
  2458. rendering engine for display or build custom PostScript code for printing.
  2459.  
  2460. --Jens Alfke
  2461.   jens_alfke@powertalk              Rebel girl, rebel girl,
  2462.             .apple.com              Rebel girl you are the queen of my world
  2463.  
  2464. +++++++++++++++++++++++++++
  2465.  
  2466. >From 103t_english@west.cscwc.pima.edu
  2467. Date: 31 May 94 15:53:49 MST
  2468. Organization: (none)
  2469.  
  2470. In article <dowdy-310594100526@17.202.68.12>, dowdy@apple.com (Tom Dowdy) writes:
  2471. > One thing Dave didn't mention is that at the WWDC during the type
  2472. > demo we showed a sample application using GX and its rich text to create
  2473. > page layouts.  The application does multiple collumns, wraps text
  2474. > around objects (using the cool GX geometry engine), and flows across
  2475. > multiple pages.  It prints (and we've used to it to create some
  2476. > cool party invites here!), saves, and can handle custom page setups
  2477. > (doesn't yet do multiple formats).
  2478. > Except for all of the "app stuff" like clipboard, typing,
  2479. > cut and paste, undo, etc -- it's pretty much fully functional.
  2480. > It's 50K of compiled code.  Something I think is quite impressive --
  2481. > and the savings comes from thinking in a GX world where the system
  2482. > handles more of the work for you.
  2483.  
  2484. Is it available as sample source code or will it be?
  2485.  
  2486.  
  2487. Lawson
  2488.  
  2489. +++++++++++++++++++++++++++
  2490.  
  2491. >From 103t_english@west.cscwc.pima.edu
  2492. Date: 31 May 94 21:14:40 MST
  2493. Organization: (none)
  2494.  
  2495. In article <1994May31.220032.15476@gallant.apple.com>, Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  2496. > John Nagle, nagle@netcom.com writes:
  2497. >> What kind of application would be simpler if written to use
  2498. >> Quickdraw GX?  
  2499. [snip]
  2500.  
  2501. > Whether the big guns like Aldubeus or Deneba will move over to GX is unclear;
  2502. > after all, they've already got code to do most of this stuff. But remember
  2503. > how after 32-bit QuickDraw appeared we started to get some good color paint
  2504. > programs from smaller developers that were cheap and reasonably powerful for
  2505. > mere mortals? That's because 32BQD made it so much easier to do offscreen
  2506. > color graphics. I think GX will have the same effect on illustration and
  2507. > typography software, since it makes it possible to do very powerful
  2508. > PostScript-style (and more!) graphics without requiring you to write your own
  2509. > rendering engine for display or build custom PostScript code for printing.
  2510. >     
  2511.  
  2512. I think that eventually even games will start making use of GX once it becomes
  2513. a standard on enough machines...
  2514.  
  2515. Will GX ship with 7.5 or later?
  2516.  
  2517.  
  2518.  
  2519. Lawson
  2520.  
  2521. +++++++++++++++++++++++++++
  2522.  
  2523. >From dank@alumni.caltech.edu (Daniel R. Kegel)
  2524. Date: 1 Jun 1994 05:45:46 GMT
  2525. Organization: California Institute of Technology, Pasadena
  2526.  
  2527. 103t_english@west.cscwc.pima.edu writes:
  2528. >I think that eventually even games will start making use of GX once it becomes
  2529. >a standard on enough machines...
  2530. Roger on that one.
  2531.  
  2532. >Will GX ship with 7.5 or later?
  2533. I hear it will ship with 7.5, but my info is a couple months old.
  2534.  
  2535. -Dan
  2536.  
  2537. +++++++++++++++++++++++++++
  2538.  
  2539. >From pd@world.std.com (Peter F Davis)
  2540. Date: Wed, 1 Jun 1994 14:24:02 GMT
  2541. Organization: The World @ Software Tool & Die
  2542.  
  2543. dowdy@apple.com (Tom Dowdy) writes:
  2544.     .
  2545.     .
  2546.     .
  2547.  
  2548. >I'd like to mention several other "nice graphics thingies" just
  2549. >to give that part of GX even time.
  2550.     .
  2551.     .
  2552.     .
  2553.  
  2554. > - curves
  2555.  
  2556. Actually, this is one of the things that really frustrates me about
  2557. GX.  Everyone else is using cubics.  Why did GX go with quadrics?
  2558.  
  2559. -pd
  2560. -- 
  2561. ===============================================================================
  2562.                 Peter Davis
  2563.  
  2564.          "Standardization is the opposite of innovation."
  2565.  
  2566. +++++++++++++++++++++++++++
  2567.  
  2568. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  2569. Date: Wed, 1 Jun 1994 21:30:07 GMT
  2570. Organization: Apple Computer
  2571.  
  2572. Peter F Davis, pd@world.std.com writes:
  2573. > Actually, this is one of the things that really frustrates me about
  2574. > GX.  Everyone else is using cubics.  Why did GX go with quadrics?
  2575.  
  2576. (1) Quadrics are a lot faster to render, and to perform other operations on
  2577. (like intersection.)
  2578.  
  2579. (2) Cubics are mathematically intractable under some geometric operations.
  2580. For example, insetting or outsetting a shape made of cubics would result in
  2581. curves of degree 6; whereas insetting or outsetting quadrics just results in
  2582. new quadrics. This kind of ability is absolutely fundamental to GX's geometry
  2583. engine, where you can apply any kind of geometric operation to a shape and
  2584. end up with another shape. Note that in PostScript you cannot do this, which
  2585. makes some kinds of operations insanely difficult or impossible. (I once
  2586. worked at a font company and we wanted to apply operations like insetting or
  2587. outsetting to character outlines. What we had to do to implement this in
  2588. PostScript would curl your hair, and it didn't even work that well. With GX
  2589. it would have been trivial.)
  2590.  
  2591. (3) In practice, for drawing, quadrics are nearly as powerful as cubics. Most
  2592. of the kinds of shapes people actually draw in illustration programs can be
  2593. rendered with only a few more quadrics than you'd need cubics for. It turns
  2594. out the kind of cubics that _are_ really difficult to approximate as quadrics
  2595. are the really twisty, loopy ones that people learn very quickly not to use
  2596. in drawing.
  2597.  
  2598. Disclaimer: I don't work on GX. Most of this is based on what I've learned
  2599. over the years or have been told by people on the GX team.
  2600.  
  2601. --Jens Alfke
  2602.   jens_alfke@powertalk              Rebel girl, rebel girl,
  2603.             .apple.com              Rebel girl you are the queen of my world
  2604.  
  2605. +++++++++++++++++++++++++++
  2606.  
  2607. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2608. Date: 2 Jun 94 17:27:53 +1200
  2609. Organization: University of Waikato, Hamilton, New Zealand
  2610.  
  2611. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle) writes:
  2612. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2613. > graphics system.  This is nice, but does it solve a real problem?
  2614.  
  2615. Absobloodylutely!
  2616.  
  2617. > It's not a full 3D system, so you can't use it for 3D graphics.
  2618. > It's not compatible with existing object-oriented graphics standards,
  2619. > like X or PHIGS.
  2620.  
  2621. I notice you didn't say "not compatible with existing _widespread_ object-
  2622. oriented graphics standards"...
  2623.  
  2624. >  It's complicated; several volume of manuals are required.
  2625.  
  2626. No it isn't! Add up all the volumes of QuickDraw and Printing Manager
  2627. documentation, including all the tech notes on printing hacks and the like.
  2628. Compare that to the size of the QuickDraw GX documentation. Now compare the
  2629. respective functionality you get. The GX API is a model of simplicity,
  2630. compared to all the accretions to QuickDraw that have accumulated over the
  2631. years.
  2632.  
  2633. > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2634. > achieve that.  What kind of application would be simpler if written to use
  2635. > Quickdraw GX?
  2636.  
  2637. ALL OF THEM!!! Other people have mentioned the typography and printing support.
  2638. Perhaps you aren't clear how much functionality GX gives you: In the
  2639. typography, you get much cleaner multilingual support than old QuickDraw is
  2640. capable of; contextual and alternate character forms; font variations
  2641. (what Adobe calls "multiple masters"); and automatic justification and kerning.
  2642.  
  2643. In the printing support, you get: anything you can draw, you can print! And
  2644. this applies to both PostScript and non-PostScript printers. You realize how
  2645. much of a breakthrough this is? All those times people have torn out their hair
  2646. over things coming out different on the printer compared to how they look on
  2647. the screen--all that goes away! And you get printer sharing and background
  2648. printing for *all* printers. And it is easier for third parties to develop
  2649. printer drivers. And it is easier still for other third parties to write
  2650. extensions that hook into the printing process in all kinds of useful ways
  2651. (such as Michael Peirce's "Peirce Print Tools").
  2652.  
  2653. And the graphics is pretty cool, too.
  2654.  
  2655. Look at it this way: when the original Macintosh came out in 1984, a lot of
  2656. people wondered why they would need the graphics and the text-graphics
  2657. integration, to do things that they were happily doing on typewriter-like
  2658. systems before. Nobody seriously asks that question any more. GX will similarly
  2659. raise people's expectations of what basic text and graphics handling is all
  2660. about.
  2661.  
  2662. The coming of the typewriter was a giant step backwards for the printed word,
  2663. and computers have only made things worse. The original Mac went a long way to
  2664. countering a lot of the pervasiveness of that "typewriter mentality". But with
  2665. QuickDraw GX, we can finally say that the computer is capable of enriching,
  2666. rather than retarding, the development of all that is best in typography, and
  2667. that the ghost of the typewriter has been well and truly laid to rest.
  2668. Long live type!
  2669.  
  2670. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  2671. Info & Tech Services Division              fax: +64-7-838-4066
  2672. University of Waikato            electric mail: ldo@waikato.ac.nz
  2673. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  2674. A: OS/2 2.1, CD-i, and the Commodore Amiga.
  2675. Q: Name 3 products which have outsold Windows NT.
  2676.  
  2677. +++++++++++++++++++++++++++
  2678.  
  2679. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2680. Date: 3 Jun 94 11:05:01 +1200
  2681. Organization: University of Waikato, Hamilton, New Zealand
  2682.  
  2683. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle) writes:
  2684.  
  2685. > [GX is] complicated; several volume of manuals are required.
  2686.  
  2687. Just to prove that GX is not only powerful for dealing with complex things,
  2688. it's also easy to use for simple things, here's a couple of minimal, _complete_
  2689. demo programs for you to compare. (I compiled and ran both versions with
  2690. THINK C 6, so I know they work.)
  2691.  
  2692. First, the QuickDraw version:
  2693.  
  2694.     #include <QuickDraw.h>
  2695.  
  2696.     void main(void)
  2697.       {
  2698.     GrafPort MyPort;
  2699.  
  2700.     InitGraf(&qd.thePort);
  2701.     OpenPort(&MyPort);
  2702.     MoveTo(100, 100);
  2703.     DrawString("\pHello, World!");
  2704.     ClosePort(&MyPort);
  2705.       } /*main*/
  2706.  
  2707. Next, the QuickDraw GX version:
  2708.  
  2709.     #include <math types.h>
  2710.     #include <math routines.h>
  2711.     #include <graphics routines.h>
  2712.  
  2713.     void main(void)
  2714.       {
  2715.     gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2716.     #define TheText "Hello, World!"
  2717.  
  2718.     GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2719.       } /*main*/
  2720.  
  2721. Now, what do you think of their relative complexity?
  2722.  
  2723. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  2724. Info & Tech Services Division              fax: +64-7-838-4066
  2725. University of Waikato            electric mail: ldo@waikato.ac.nz
  2726. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  2727. Please do not feed the vegetables.
  2728.  
  2729. +++++++++++++++++++++++++++
  2730.  
  2731. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  2732. Date: Fri, 3 Jun 94 16:09:15 PST
  2733. Organization: Peirce Software, Inc.
  2734.  
  2735.  
  2736. In article <2smvne$mkg@news.kth.se> (comp.sys.mac.programmer), d88-jwa@dront.nada.kth.se (Jon Wdtte) writes:
  2737. > >3. No stupid conversions and typecasting to remember all over the place.
  2738. > Okay, I buy that.
  2739.  
  2740. Personally I blame that on C.  C just doesn't have a "native"
  2741. fixed type with associated operations.
  2742.  
  2743. Also (very minor point) I use the ff() macro rather than the
  2744. IntToFixed() - they are equivalent, but ff is more compact.
  2745.  
  2746. I do wish there was a VALIDATE mode that would yell when it
  2747. started seeing coordinates like 0x00000001 rather than
  2748. 0x00010000.  Such tiny coordinates can't be common or generally
  2749. useful.
  2750.  
  2751. I have gotten into trouble by passing integer coordinates rather
  2752. than fixed coordinates, though they aren't hard bugs to figure
  2753. out.
  2754. ____________
  2755.  
  2756. My only real grip with GX is that the interface is opague.  I
  2757. understand the rational that they might/will change things
  2758. inside at a later date.  That's well and good, but it makes it
  2759. MUCH harder to debug. With old QuickDraw I could root around in
  2760. the debugger and see exactly what my visRegion was set to and
  2761. such.  With GX there is no way to see, for example, what my Ink
  2762. happens to be or my clip shape or whatever.
  2763.  
  2764. They supply GraphicsBug, but it's basically useless for the kind
  2765. of work I do (non-applications).  And it's a pretty aweful
  2766. interface even for app use - it makes Jasik look like an UI
  2767. god. [ 1/2 :-) ]  And it crashes all the time for me.
  2768.  
  2769. What I'd like to see is a way to peer inside.  Make it 100%
  2770. clear that things will change and all that, but allow us to
  2771. debug things in a reasonable way!
  2772.  
  2773. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  2774. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  2775. __                       __ San Jose, California USA 95117-1844
  2776. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  2777. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  2778.  
  2779. +++++++++++++++++++++++++++
  2780.  
  2781. >From Rick Wong <rick@jessica.stanford.edu>
  2782. Date: 3 Jun 1994 23:06:32 GMT
  2783. Organization: Stanford University
  2784.  
  2785. In article <1994Jun3.093501.1@west.cscwc.pima.edu> ,
  2786. 103t_english@west.cscwc.pima.edu writes:
  2787. >Perhaps the sample source code to draw the same text a dozen times,
  2788. rotated by
  2789. >30 degrees each time in a loop?
  2790. >
  2791. >Takes only a few lines more than simply drawing the text in the first
  2792. place...
  2793. >
  2794. >
  2795. >Lawson
  2796.  
  2797.  
  2798. #include <math types.h>
  2799. #include <math routines.h>
  2800. #include <graphics routines.h>
  2801. #include <string.h>
  2802.  
  2803. #define TheText "GX Rules!"
  2804.  
  2805. void main(void)
  2806. {
  2807.     gxPoint myPoint = {ff(100), ff(100)};
  2808.     gxShape myTextShape = GXNewText(strlen(TheText), TheText, &myPoint);
  2809.     gxTransform myShapeTransform = GXGetShapeTransform(myTextShape);
  2810.     int i;
  2811.     for (i = 0; i < 12; ++i) {
  2812.         GXDrawShape(myTextShape);
  2813.         GXRotateTransform(myShapeTransform, ff(30), myPoint.x, myPoint.y);
  2814.     }
  2815.     GXDisposeShape(myTextShape);
  2816. }
  2817.  
  2818.  
  2819. Any sort of rotation operation (including bitmaps) is trivial with
  2820. QuickDraw GX.  This doesn't even nick the surface of its capabilities.
  2821.  
  2822. I am just starting to read the QD GX docs, and I must say that I am
  2823. quite impressed by the job Apple's done.  Not only is QD GX loaded
  2824. with great new features, the underlying model is indeed well thought
  2825. out, and the APIs are exemplary in their cleanness and consistency.
  2826. I'm going to enjoy forgetting everything I ever learned about PixMaps,
  2827. GDevices, cluts, etc.
  2828.  
  2829.  
  2830. Rick Wong
  2831.  
  2832. +++++++++++++++++++++++++++
  2833.  
  2834. >From sho@bohr.physics.purdue.edu (Sho Kuwamoto)
  2835. Date: 3 Jun 94 17:35:05 GMT
  2836. Organization: Purdue University Physics Department
  2837.  
  2838. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  2839. >    #include <math types.h>
  2840. >    #include <math routines.h>
  2841. >    #include <graphics routines.h>
  2842. >
  2843. >    void main(void)
  2844. >      {
  2845. >    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2846. >    #define TheText "Hello, World!"
  2847. >
  2848. >    GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2849. >      } /*main*/
  2850.  
  2851. One thing I'd like to see is a way to specify fixed point
  2852. constants from within the mac C compilers.  What?  Did I
  2853. hear you cry, "nonstandard"?  Well, what about four byte
  2854. chars (e.g., 'APPL')?  How standard are they?
  2855.  
  2856. I imagine being able to type 100F to represent a fixed point
  2857. 100 in much the same way that one types 100L to represent a
  2858. long int 100.  I realize it's grossly nonstandard, but
  2859. wouldn't it make GX so much easier?
  2860.  
  2861. -Sho
  2862. --
  2863. sho@physics.purdue.edu <<-- finger this account to find out what I'm
  2864.                             having for lunch!
  2865.  
  2866. <A HREF="http://physics.purdue.edu/~sho/homepage.html">Sho Kuwamoto</A>.
  2867.  
  2868. +++++++++++++++++++++++++++
  2869.  
  2870. >From blm@coho.halcyon.com (Brian L. Matthews)
  2871. Date: 4 Jun 1994 01:06:33 GMT
  2872. Organization: A World of Information at Your Fingertips
  2873.  
  2874. In article <16887@dirac.physics.purdue.edu>,
  2875. Sho Kuwamoto <sho@bohr.physics.purdue.edu> wrote:
  2876. |>    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2877. |
  2878. |One thing I'd like to see is a way to specify fixed point
  2879. |constants from within the mac C compilers.
  2880.  
  2881. Well, if you're willing to switch to C++, it would be fairly easy to
  2882. make some classes so you could just say:
  2883.  
  2884.     gxPoint where = { 100, 100 };
  2885.  
  2886. and the compiler (with the help of some classes you write) would do the
  2887. right thing.
  2888.  
  2889. One could also be clever and make it so:
  2890.  
  2891.     gxPoint where = { 10.53, 9.47 };
  2892.  
  2893. also does (usually) the right thing.  And all without modifying the language.
  2894.  
  2895. This would also fix problems with accidentally passing an int where Fixed
  2896. was expected.  With proper declarations, such a thing wouldn't be possible
  2897. (well, wouldn't be easy.  Anything's possible in C :-)).
  2898.  
  2899. Brian
  2900.  
  2901. +++++++++++++++++++++++++++
  2902.  
  2903. >From nagle@netcom.com (John Nagle)
  2904. Date: Sat, 4 Jun 1994 06:02:23 GMT
  2905. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  2906.  
  2907. sho@bohr.physics.purdue.edu (Sho Kuwamoto) writes:
  2908. >One thing I'd like to see is a way to specify fixed point
  2909. >constants from within the mac C compilers.  What?  Did I
  2910. >hear you cry, "nonstandard"?  Well, what about four byte
  2911. >chars (e.g., 'APPL')?  How standard are they?
  2912.  
  2913.       Actually, multicharacter constants are standard C and C++, although
  2914. they are a recent addition to the language.
  2915.  
  2916. >I imagine being able to type 100F to represent a fixed point
  2917. >100 in much the same way that one types 100L to represent a
  2918. >long int 100.  I realize it's grossly nonstandard, but
  2919. >wouldn't it make GX so much easier?
  2920.  
  2921.       Why build it into the language?  Just add the new type.
  2922.  
  2923.      class QDfixed {
  2924.     long fval;
  2925.      public:
  2926.     QDfixed(int intval) { fval = intval * int_scale_factor; }
  2927.     QDfixed(QDfixed fixedval) { fval = fixedval.fval; }
  2928.     QDfixed(int intval, int fractpart) { fval = intval * int_scale_factor
  2929.                     + fractpart; }
  2930.         ....
  2931.      }
  2932.  
  2933. You get the idea.
  2934. Of course, because the Mac interface is still defined in terms of C, not
  2935. C++, the standard headers won't support this properly, but that could be
  2936. fixed with some glue routines expressed as inlines.
  2937.  
  2938.                     John Nagle
  2939.  
  2940. +++++++++++++++++++++++++++
  2941.  
  2942. >From marke@infi.net (Mark Eaton)
  2943. Date: 4 Jun 1994 18:06:09 GMT
  2944. Organization: InfiNet
  2945.  
  2946. Ralph Martin (Ralph.Martin@cm.cf.ac.uk) wrote:
  2947. : In article <1994Jun3.110501.29244@waikato.ac.nz> Lawrence D'Oliveiro,
  2948. : ldo@waikato.ac.nz writes:
  2949. : >Next, the QuickDraw GX version:
  2950. : >
  2951. : >    #include <math types.h>
  2952. : >    #include <math routines.h>
  2953. : >    #include <graphics routines.h>
  2954. : >
  2955. : >    void main(void)
  2956. : >      {
  2957. : >    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2958. : >    #define TheText "Hello, World!"
  2959. : >
  2960. : >    GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2961. : >      } /*main*/
  2962. : >
  2963. : >Now, what do you think of their relative complexity?
  2964.  
  2965. : It's not obvious:
  2966.  
  2967. : Good points for Quickdraw:
  2968. : 1. Less headers.
  2969.  
  2970. I wonder if compiler providers like Symantec and MetroWerks will come up
  2971. with a unified header for GX that includes the necessary headers... Its just
  2972. a matter of time.
  2973.  
  2974. : 2. Functionality divided into smaller chunks (what to draw, where to draw
  2975. : separate).
  2976.  
  2977. Yes, but now we arent restricted to one 'pen'. We can have any number of
  2978. points without having to call move and moveto constantly. I think the new
  2979. way is better.
  2980.  
  2981. : 3. No stupid conversions and typecasting to remember all over the place.
  2982.  
  2983. : Good points for Quickdraw GX:
  2984. : 4. No rubbish concerning initialising and setting up ports.
  2985.  
  2986. : Overall - the Quickdraw is easier to read, and looks more maintainable
  2987. : and less error prone because of point 3. It is probably easier to write
  2988. : given point 2, as the programmer has to concentrate on less things at
  2989. : once.
  2990.  
  2991. Had he used unsigned char* theText = "Hello World"; he wouldnt have needed a
  2992. cast. He used a numdefine instead... It was a programmer choice...
  2993.  
  2994. : Seriously, you are probably right about QuickDraw GX having a better
  2995. : model underlying it. I'm not so sure that the realisation of that model
  2996. : into an API is a great leap forward though. Perhaps longer examples would
  2997. : be more convincing!
  2998.  
  2999. : Ralph
  3000.  
  3001. --
  3002.  
  3003. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3004. Mark Eaton          | MacXPerts - Custom Mac and Newton Software
  3005. marke@infi.net      | 3228L W. Cary St.
  3006.                     | Richmond, VA. 23221
  3007.             | (804) 353-7122     FAX: (804) 358-3847
  3008.  
  3009. +++++++++++++++++++++++++++
  3010.  
  3011. >From marke@infi.net (Mark Eaton)
  3012. Date: 4 Jun 1994 18:11:20 GMT
  3013. Organization: InfiNet
  3014.  
  3015. Rick Wong (rick@jessica.stanford.edu) wrote:
  3016. : #define TheText "GX Rules!"
  3017.  
  3018. : void main(void)
  3019. : {
  3020. :     gxPoint myPoint = {ff(100), ff(100)};
  3021. :     gxShape myTextShape = GXNewText(strlen(TheText), TheText, &myPoint);
  3022.  
  3023. Its interesting that GX uses shapes and converts text to shapes. This is
  3024. very much like the Newton form of QuickDraw. Did some of the engineers work
  3025. on both, or is this just coincidence?
  3026.  
  3027. :     gxTransform myShapeTransform = GXGetShapeTransform(myTextShape);
  3028. :     int i;
  3029. :     for (i = 0; i < 12; ++i) {
  3030. :         GXDrawShape(myTextShape);
  3031. :         GXRotateTransform(myShapeTransform, ff(30), myPoint.x, myPoint.y);
  3032. :     }
  3033. :     GXDisposeShape(myTextShape);
  3034. : }
  3035.  
  3036.  
  3037. : Any sort of rotation operation (including bitmaps) is trivial with
  3038. : QuickDraw GX.  This doesn't even nick the surface of its capabilities.
  3039.  
  3040. : I am just starting to read the QD GX docs, and I must say that I am
  3041. : quite impressed by the job Apple's done.  Not only is QD GX loaded
  3042. : with great new features, the underlying model is indeed well thought
  3043. : out, and the APIs are exemplary in their cleanness and consistency.
  3044. : I'm going to enjoy forgetting everything I ever learned about PixMaps,
  3045. : GDevices, cluts, etc.
  3046.  
  3047. Much agreed!
  3048.  
  3049. : Rick Wong
  3050.  
  3051. --
  3052.  
  3053. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3054. Mark Eaton          | MacXPerts - Custom Mac and Newton Software
  3055. marke@infi.net      | 3228L W. Cary St.
  3056.                     | Richmond, VA. 23221
  3057.             | (804) 353-7122     FAX: (804) 358-3847
  3058.  
  3059. +++++++++++++++++++++++++++
  3060.  
  3061. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3062. Date: 7 Jun 94 11:41:28 +1200
  3063. Organization: University of Waikato, Hamilton, New Zealand
  3064.  
  3065. In article <2sqfqh$l0r@lucy.infi.net>, marke@infi.net (Mark Eaton) writes:
  3066. >
  3067. > Had he used unsigned char* theText = "Hello World"; he wouldnt have needed a
  3068. > cast. He used a numdefine instead... It was a programmer choice...
  3069.  
  3070. Actually, it was my ignorance of C showing. :-}
  3071.  
  3072. Seriously, though, if unsigned char* theText = "Hello World" compiles without
  3073. needing a cast, while I needed a cast to pass the exact same literal to an
  3074. unsigned char* argument, isn't that an inconsisten-C?
  3075.  
  3076. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3077. Info & Tech Services Division              fax: +64-7-838-4066
  3078. University of Waikato            electric mail: ldo@waikato.ac.nz
  3079. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3080.  
  3081. +++++++++++++++++++++++++++
  3082.  
  3083. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3084. Date: 7 Jun 94 11:46:51 +1200
  3085. Organization: University of Waikato, Hamilton, New Zealand
  3086.  
  3087. In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3088. >
  3089. > Also (very minor point) I use the ff() macro rather than the
  3090. > IntToFixed() - they are equivalent, but ff is more compact.
  3091.  
  3092. I deliberately used IntToFixed to try to make it clearer what was going on.
  3093.  
  3094. > What I'd like to see is a way to peer inside.  Make it 100%
  3095. > clear that things will change and all that, but allow us to
  3096. > debug things in a reasonable way!
  3097.  
  3098. There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3099. If you have a look at the source of SlideMaster that came with the beta 1
  3100. distribution, you can see an example of this in use (it makes a big difference
  3101. to the speed of the "Particles" animation!).
  3102.  
  3103. All you need is some documentation on how to use this, or, failing that, some
  3104. time spent poking around for yourself...
  3105.  
  3106. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3107. Info & Tech Services Division              fax: +64-7-838-4066
  3108. University of Waikato            electric mail: ldo@waikato.ac.nz
  3109. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3110.  
  3111. +++++++++++++++++++++++++++
  3112.  
  3113. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3114. Date: 7 Jun 94 12:02:22 +1200
  3115. Organization: University of Waikato, Hamilton, New Zealand
  3116.  
  3117. In article <1994Jun3.094115.17117@cm.cf.ac.uk>, Ralph Martin <Ralph.Martin@cm.cf.ac.uk> writes:
  3118. > In article <1994Jun3.110501.29244@waikato.ac.nz> Lawrence D'Oliveiro,
  3119. > ldo@waikato.ac.nz writes:
  3120. >>
  3121. >>Now, what do you think of their relative complexity?
  3122. >
  3123. > Good points for Quickdraw:
  3124. > 2. Functionality divided into smaller chunks (what to draw, where to draw
  3125. > separate).
  3126.  
  3127. Actually, this statement is more true of GX in general. My sample code was for
  3128. drawing text: consider equivalent code for drawing, say, polygons. (Do you want
  3129. me to inflict some on you?)
  3130.  
  3131. > 3. No stupid conversions and typecasting to remember all over the place.
  3132.  
  3133. I was using THINK C for communication purposes. Normally I use Modula-2.
  3134. Much less typecasting. :-)
  3135.  
  3136. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3137. Info & Tech Services Division              fax: +64-7-838-4066
  3138. University of Waikato            electric mail: ldo@waikato.ac.nz
  3139. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3140.  
  3141. +++++++++++++++++++++++++++
  3142.  
  3143. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3144. Date: 7 Jun 94 12:04:03 +1200
  3145. Organization: University of Waikato, Hamilton, New Zealand
  3146.  
  3147. In article <2smvne$mkg@news.kth.se>, d88-jwa@dront.nada.kth.se (Jon Wdtte) writes:
  3148. > In <1994Jun3.094115.17117@cm.cf.ac.uk> Ralph Martin <Ralph.Martin@cm.cf.ac.uk> writes:
  3149. >
  3150. >>Good points for Quickdraw GX:
  3151. >>4. No rubbish concerning initialising and setting up ports.
  3152. >
  3153. > Actually, there is; Lawrence was cheating (or rather not using
  3154. > a relevant test case)
  3155.  
  3156. I wasn't cheating. The GX documentation says you can leave out all the client
  3157. setup if the defaults are adequate, and in this case, they were!
  3158.  
  3159. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3160. Info & Tech Services Division              fax: +64-7-838-4066
  3161. University of Waikato            electric mail: ldo@waikato.ac.nz
  3162. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3163.  
  3164. +++++++++++++++++++++++++++
  3165.  
  3166. >From zstern@adobe.com (Zalman Stern)
  3167. Date: Tue, 7 Jun 1994 01:21:35 GMT
  3168. Organization: Adobe Systems Incorporated
  3169.  
  3170. Lawrence D'Oliveiro, Waikato University writes
  3171. > Seriously, though, if unsigned char* theText = "Hello World" compiles  
  3172. without
  3173. > needing a cast, while I needed a cast to pass the exact same literal to an
  3174. > unsigned char* argument, isn't that an inconsisten-C?
  3175.  
  3176. Its not an inconsistency because it doesn't compile.
  3177. --
  3178. Zalman Stern           zalman@adobe.com            (415) 962 3824
  3179. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  3180.    Never let a "final candidate" subscript get above the age of consent.
  3181.  
  3182. +++++++++++++++++++++++++++
  3183.  
  3184. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3185. Date: Mon, 6 Jun 94 20:25:05 PST
  3186. Organization: Peirce Software, Inc.
  3187.  
  3188.  
  3189. In article <1994Jun7.114651.29344@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3190. > In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3191. > >
  3192. > > Also (very minor point) I use the ff() macro rather than the
  3193. > > IntToFixed() - they are equivalent, but ff is more compact.
  3194. > I deliberately used IntToFixed to try to make it clearer what was going on.
  3195. > > What I'd like to see is a way to peer inside.  Make it 100%
  3196. > > clear that things will change and all that, but allow us to
  3197. > > debug things in a reasonable way!
  3198. > There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3199.  
  3200. GXGetShapeStructure will return geometry information about a shape.
  3201. Other calls can also return infomation about other stuff like inks
  3202. and transforms.
  3203.  
  3204. With these it is possible to build some sort of debugging library
  3205. yourself, but it really doesn't help much when you are stepping through
  3206. source code and need to see what the ink of a given shape is or maybe
  3207. its transform.
  3208.  
  3209. GraphicsBug tries to address some of this, but it was clearly written
  3210. by someone that thinks Macsbug was a great model to follow for a debugger
  3211. UI :-(  It's completely unusable by folks who don't have a friendly event
  3212. loop handly.  People who write print drivers or extensions or even App
  3213. code that uses GX for just a little work, then cleans up before idle
  3214. time are left in a lurch.  I had to dust off some really old code
  3215. that spits out debugging information over the net to a log app so I can
  3216. get some idea what's going on deep in the bowels of message overrides.
  3217. This is code that I haven't had to use since symbolic debugging arrived
  3218. on the Mac many moons ago.
  3219.  
  3220. Maybe I'm carrying on at a bit too much length, but having spend the
  3221. last months debugging our printing extensions and I've wasted large
  3222. amounts of time because its hard to debug GX code.  (You also have
  3223. to jump through hoops to get source debugging to work with print drivers
  3224. and extensions, but that's yet another story!).
  3225.  
  3226. The easier it is to debug GX apps and such, the sooner they will start
  3227. showing up.
  3228.  
  3229. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3230. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3231. __                       __ San Jose, California USA 95117-1844
  3232. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3233. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3234.  
  3235. +++++++++++++++++++++++++++
  3236.  
  3237. >From mxmora@unix.sri.com (Matt Mora)
  3238. Date: 7 Jun 1994 13:33:06 -0700
  3239. Organization: SRI International, Menlo Park, CA
  3240.  
  3241. In article <CNjbKKKX.1idl0m@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3242.  
  3243. >GraphicsBug tries to address some of this, but it was clearly written
  3244. >by someone that thinks Macsbug was a great model to follow for a debugger
  3245. >UI :-(  It's completely unusable by folks who don't have a friendly event
  3246. >loop handly.  People who write print drivers or extensions or even App
  3247.  
  3248.  
  3249. I thought that the GX team answered your question about that. Didn't
  3250. they mention that there is a call you can use to simulate a Event
  3251. loop?
  3252.  
  3253.  
  3254. Xavier
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260. -- 
  3261. ___________________________________________________________
  3262. Matthew Xavier Mora                       Matt_Mora@sri.com
  3263. SRI International                       mxmora@unix.sri.com
  3264. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  3265.  
  3266. +++++++++++++++++++++++++++
  3267.  
  3268. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3269. Date: Tue, 7 Jun 94 15:06:31 PST
  3270. Organization: Peirce Software, Inc.
  3271.  
  3272.  
  3273. In article <1994May31.211440.1@west.cscwc.pima.edu> (comp.sys.mac.programmer), 103t_english@west.cscwc.pima.edu writes:
  3274. > Will GX ship with 7.5 or later?
  3275.  
  3276. QuickDraw GX swill ship with 7.5.  Before then, GX can be licensed
  3277. by third party companies that want to include it with their products.
  3278.  
  3279. Since our Peirce Print Tools won't work without GX, we are in the
  3280. process of licensing GX and will bundle it in with our product
  3281. in a week (or two or three depending on how long it takes Apple licensing
  3282. to process the paperwork!).  It's four HDFD disks and will work with
  3283. System 7.1 or later.
  3284.  
  3285. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3286. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3287. __                       __ San Jose, California USA 95117-1844
  3288. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3289. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3290.  
  3291. +++++++++++++++++++++++++++
  3292.  
  3293. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3294. Date: 9 Jun 94 11:39:00 +1200
  3295. Organization: University of Waikato, Hamilton, New Zealand
  3296.  
  3297. In article <CNjbKKKX.1idl0m@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3298. >
  3299. > In article <1994Jun7.114651.29344@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3300. >> In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3301. >>
  3302. >> > What I'd like to see is a way to peer inside.  Make it 100%
  3303. >> > clear that things will change and all that, but allow us to
  3304. >> > debug things in a reasonable way!
  3305. >>
  3306. >> There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3307. >
  3308. > GXGetShapeStructure will return geometry information about a shape.
  3309. > Other calls can also return infomation about other stuff like inks
  3310. > and transforms.
  3311. >
  3312. > With these it is possible to build some sort of debugging library
  3313. > yourself, but it really doesn't help much when you are stepping through
  3314. > source code and need to see what the ink of a given shape is or maybe
  3315. > its transform.
  3316.  
  3317. You could write a MacsBug dcmd or two to make these calls. Since GX is
  3318. supposed to be interrupt-reentrant, they might even work quite safely.
  3319.  
  3320. > GraphicsBug [is] completely unusable by folks who don't have a friendly event
  3321. > loop handly.  People who write print drivers or extensions or even App
  3322. > code that uses GX for just a little work, then cleans up before idle
  3323. > time are left in a lurch.
  3324.  
  3325. Here's the tip that was given out at the GX in QD apps and debugging tips
  3326. session at WWDC: break into MacsBug, switch to the system heap zone, then type
  3327. "g InitEventLoop" (I think that's how it's spelt). This is supposed to get you
  3328. into a dummy event loop so you can use GraphicsBug on your driver/extension.
  3329.  
  3330. By the way, I think this only works with the debugging version of GX. MacsBug
  3331. can't seem to find a symbol resembling this in the 1.0f2c13 (non-debugging)
  3332. version I'm running.
  3333.  
  3334. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3335. Info & Tech Services Division              fax: +64-7-838-4066
  3336. University of Waikato            electric mail: ldo@waikato.ac.nz
  3337. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3338.  
  3339. +++++++++++++++++++++++++++
  3340.  
  3341. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3342. Date: Wed, 8 Jun 94 21:52:09 PST
  3343. Organization: Peirce Software, Inc.
  3344.  
  3345.  
  3346. In article <1994Jun9.113900.29449@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3347. > Here's the tip that was given out at the GX in QD apps and debugging tips
  3348. > session at WWDC: break into MacsBug, switch to the system heap zone, then type
  3349. > "g InitEventLoop" (I think that's how it's spelt). This is supposed to get you
  3350. > into a dummy event loop so you can use GraphicsBug on your driver/extension.
  3351. > By the way, I think this only works with the debugging version of GX. MacsBug
  3352. > can't seem to find a symbol resembling this in the 1.0f2c13 (non-debugging)
  3353. > version I'm running.
  3354.  
  3355. Right, but who uses Macsbug?  Seriously. I guess the GX team does.
  3356.  
  3357. Yikes!
  3358.  
  3359. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3360. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3361. __                       __ San Jose, California USA 95117-1844
  3362. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3363. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3364.  
  3365. +++++++++++++++++++++++++++
  3366.  
  3367. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  3368. Date: Mon, 13 Jun 1994 09:56:34 +0800
  3369. Organization: Department of Computer Science, The University of Western Australia
  3370.  
  3371. In article <1994Jun3.094115.17117@cm.cf.ac.uk>, Ralph Martin
  3372. <Ralph.Martin@cm.cf.ac.uk> wrote:
  3373.  
  3374. >Seriously, you are probably right about QuickDraw GX having a better
  3375. >model underlying it. I'm not so sure that the realisation of that model
  3376. >into an API is a great leap forward though. Perhaps longer examples would
  3377. >be more convincing!
  3378.  
  3379. The important point is not whether GX is simpler, it's that you can do
  3380. more.  Colour QuickDraw is fine until you hit one of its boundaries and
  3381. then you suffer much pain and misery trying to work around it.  With GX
  3382. the boundaries are much further out, thus you're less likely to hit them. 
  3383. The classic example here is rotated text.
  3384.  
  3385. Hmm, of course when you do hit GX's boundaries...
  3386. -- 
  3387. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  3388. Department of Computer Science, The University of Western Australia
  3389.   Who, as a Mac user as well as a programmer, can't wait for GX drawing/DTP.
  3390.   And is glad he doesn't have to write it (:
  3391.  
  3392. ---------------------------
  3393.  
  3394. >From tboucher@teleport.com (Tyson B. Boucher)
  3395. Subject: [Q] Programming the AT&T 3210?
  3396. Date: Thu, 09 Jun 1994 03:15:16 -0800
  3397. Organization: Teleport - Portland's Public Access (503) 220-1016
  3398.  
  3399.     Does anyone know of a cheap/free way to learn how to program the 3210
  3400. (the DSP in av Macs)?  IUd like to take advantage of it, but IUm still
  3401. working on getting a full set of IM, so I donUt want to spend a lot buying
  3402. a manual from AT&T if I can help it.  Besides, this is (for now) just a
  3403. casual interest and I donUt want to toss a lot of $$$ after this if it
  3404. turns out to be not worth it.
  3405.  
  3406. -- 
  3407. |          tboucher@teleport.com           |
  3408. |                   /-Student              |
  3409. |  Tyson B. Boucher-|-Programmer           |
  3410. |                   \-lifeless.net.bum  ;) |
  3411.  
  3412. +++++++++++++++++++++++++++
  3413.  
  3414. >From Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM>
  3415. Date: Fri, 10 Jun 1994 13:55:13 GMT
  3416. Organization: AT&T Global Information Solutions, Atlanta
  3417.  
  3418. >In article <tboucher-090694031516@ip-ca.teleport.com> Tyson B. Boucher writes: 
  3419. >    Does anyone know of a cheap/free way to learn how to program the 3210
  3420. >(the DSP in av Macs)?  IUd like to take advantage of it, but IUm still
  3421. >working on getting a full set of IM, so I donUt want to spend a lot buying
  3422. >a manual from AT&T if I can help it.  Besides, this is (for now) just a
  3423. >casual interest and I donUt want to toss a lot of $$$ after this if it
  3424. >turns out to be not worth it.
  3425.  
  3426. First off, most readers don't recognize the funky characters you've got in
  3427. your post. You might want to use standard ascii when posting.
  3428.  
  3429. But to answer your question, The manual for the language is free from AT&T.
  3430. I don't have the address with me right now.
  3431.  
  3432. The commercially available development system is $1000. Some people on the
  3433. net are trying to write one that I assume will be ftp'able from the major mac
  3434. archive sites. There is a group called comp.dsp. You might want to check it
  3435. out and ask for the Mac DSP mini-faq. It has more info. (like the phone number
  3436. for the free manual.)
  3437.  
  3438. Darrin
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446. +++++++++++++++++++++++++++
  3447.  
  3448. >From qmot@cs.mcgill.ca (Thomas PUSHPATHADAM)
  3449. Date: 11 Jun 1994 21:19:10 GMT
  3450. Organization: SOCS, McGill University, Montreal, Canada
  3451.  
  3452. (*** Note:  posting from borrowed account ***)
  3453.  
  3454. > Does anyone know of a cheap/free way to learn how to program the 3210
  3455. > (the DSP in av Macs)?  IUd like to take advantage of it, but IUm
  3456. > still
  3457. > working on getting a full set of IM, so I donUt want to spend a lot
  3458. > buying
  3459. > a manual from AT&T if I can help it.  Besides, this is (for now) just
  3460. > a casual interest and I donUt want to toss a lot of $$$ after this if
  3461. > it turns out to be not worth it.
  3462.  
  3463. Stefan Arentz (arentz@batcave.knoware.nl), Andrew Grignon
  3464. (Andrew-Grignon@uiowa.edu) and myself (Paul Lalonde,
  3465. paul@architecture.mcgill.ca) are currently writing an assembler for the
  3466. DSP3210.  Since we're doing this in our scarce spare time, it's moving
  3467. rather slowly.  We want to upload to the major ftp sites by the end of
  3468. June.
  3469.  
  3470. In the meantime, you might call AT&T and ask for the "DSP3210
  3471. information manual".  It's free, and it introduces you to the DSP's
  3472. instruction set.  Their number is 1-800-372-2447.
  3473.  
  3474. You will also need the "Centris  660AV & Quadra 840AV developer note",
  3475. available on more recent Bookmark & developer CDs.  This documents the 
  3476. interface to the DSP.
  3477.  
  3478. Hope this helps,
  3479.  
  3480. Paul Lalonde
  3481. paul@architecture.mcgill.ca
  3482.  
  3483.  
  3484. +++++++++++++++++++++++++++
  3485.  
  3486. >From amanda@intercon.com (Amanda Walker)
  3487. Date: Mon, 13 Jun 1994 14:32:50 -0500
  3488. Organization: InterCon Systems Corporation, Herndon, VA  USA
  3489.  
  3490. Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM> writes:
  3491. > The commercially available development system is $1000. 
  3492.  
  3493. Spectral Innovations is now selling the ARTA development for $495 without 
  3494. support ($995 includes support).  I wouldn't advise doing this unless you've
  3495. done DSP code before, though :)...
  3496.  
  3497.  
  3498. Amanda Walker
  3499. InterCon Systems Corporation
  3500.  
  3501.  
  3502.  
  3503. ---------------------------
  3504.  
  3505. End of C.S.M.P. Digest
  3506. **********************
  3507.  
  3508.  
  3509. ˇ